vweb: init_once()
parent
2dc547a45c
commit
2ed4457c5f
|
@ -137,7 +137,7 @@ pub fn run_app<T>(mut app T, port int) {
|
||||||
println('Running a Vweb app on http://localhost:$port ...')
|
println('Running a Vweb app on http://localhost:$port ...')
|
||||||
l := net.listen(port) or { panic('failed to listen') }
|
l := net.listen(port) or { panic('failed to listen') }
|
||||||
app.vweb = Context{}
|
app.vweb = Context{}
|
||||||
app.init()
|
app.init_once()
|
||||||
//app.reset()
|
//app.reset()
|
||||||
for {
|
for {
|
||||||
conn := l.accept() or { panic('accept() failed') }
|
conn := l.accept() or { panic('accept() failed') }
|
||||||
|
@ -285,6 +285,7 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
|
||||||
//$if debug {
|
//$if debug {
|
||||||
println('action=$action')
|
println('action=$action')
|
||||||
//}
|
//}
|
||||||
|
app.init()
|
||||||
app.$action()
|
app.$action()
|
||||||
/*
|
/*
|
||||||
app.$action() or {
|
app.$action() or {
|
||||||
|
@ -292,7 +293,7 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
conn.close() or {}
|
conn.close() or {}
|
||||||
app.reset()
|
//app.reset()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue