1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: init_once()

This commit is contained in:
Alexander Medvednikov 2020-06-10 11:23:41 +02:00
parent 2dc547a45c
commit 2ed4457c5f

View File

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