From fb6aa8d1be147ccb9f82238f7531bf334ea801f7 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 31 Dec 2007 10:01:47 +0000 Subject: [PATCH] cgi: actually use the connection from the new login after logging in! Organization: Straylight/Edgeware From: rjk@greenend.org.uk <> --- server/dcgi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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"); -- [mdw]