From: rjk@greenend.org.uk <> Date: Mon, 31 Dec 2007 10:01:47 +0000 (+0000) Subject: cgi: actually use the connection from the new login after logging in! X-Git-Tag: 3.0~128 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/fb6aa8d1be147ccb9f82238f7531bf334ea801f7?hp=ac152d06f4cfa9abcd4a88de7dbc6a9040f99c0d cgi: actually use the connection from the new login after logging in! --- diff --git a/server/dcgi.c b/server/dcgi.c index 27c77b1..caaea64 100644 --- a/server/dcgi.c +++ b/server/dcgi.c @@ -464,7 +464,8 @@ static void act_login(cgi_sink *output, expand_template(ds, output, "login"); return; } - c = disorder_new(1); + /* We'll need a new connection as we are going to stop being guest */ + c = disorder_new(0); if(disorder_connect_user(c, username, password)) { cgi_set_option("error", "loginfailed"); expand_template(ds, output, "login"); @@ -475,6 +476,9 @@ static void act_login(cgi_sink *output, expand_template(ds, output, "login"); return; } + /* Use the new connection henceforth */ + ds->g->client = c; + ds->g->flags = 0; /* We have a new cookie */ header_cookie(output->sink); cgi_set_option("status", "loginok");