From 68dcf6ef3bb2898b7317aed80569c872b867438b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 21 May 2009 22:46:28 +0000 Subject: [PATCH] * don't send cookies with static data; we don't know what to put in them here. --- webcit/context_loop.c | 2 +- webcit/static.c | 2 +- webcit/webcit.c | 33 ++++++++++++++++++--------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/webcit/context_loop.c b/webcit/context_loop.c index 93e7a5f82..de41b1dba 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -460,7 +460,7 @@ void context_loop(int *sock) /* How long did this transaction take? */ gettimeofday(&tx_finish, NULL); - lprintf(9, "Transaction [%s] completed in %ld.%06ld seconds.\n", + lprintf(9, "SL: Transaction [%s] completed in %ld.%06ld seconds.\n", ChrPtr(Hdr.this_page), ((tx_finish.tv_sec*1000000 + tx_finish.tv_usec) - (tx_start.tv_sec*1000000 + tx_start.tv_usec)) / 1000000, ((tx_finish.tv_sec*1000000 + tx_finish.tv_usec) - (tx_start.tv_sec*1000000 + tx_start.tv_usec)) % 1000000 diff --git a/webcit/static.c b/webcit/static.c index 7e5580b27..e432d53ed 100644 --- a/webcit/static.c +++ b/webcit/static.c @@ -79,7 +79,7 @@ void output_static(const char *what) #ifndef TECH_PREVIEW lprintf(9, "output_static('%s') %s\n", what, content_type); #endif - http_transmit_thing(content_type, 1); + http_transmit_thing(content_type, 2); } if (yesbstr("force_close_session")) { end_webcit_session(); diff --git a/webcit/webcit.c b/webcit/webcit.c index 7531ac49e..680003e2f 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -135,7 +135,7 @@ void output_headers( int do_httpheaders, /* 1 = output HTTP headers PACKAGE_STRING); } - if (cache) { + if (cache > 0) { char httpTomorow[128]; http_datestring(httpTomorow, sizeof httpTomorow, @@ -156,20 +156,23 @@ void output_headers( int do_httpheaders, /* 1 = output HTTP headers ); } - stuff_to_cookie(cookie, 1024, - WCC->wc_session, - WCC->wc_username, - WCC->wc_password, - WCC->wc_roomname, - get_selected_language() - ); + if (cache < 2) { - if (unset_cookies) { - hprintf("Set-cookie: webcit=%s; path=/\r\n", unset); - } else { - hprintf("Set-cookie: webcit=%s; path=/\r\n", cookie); - if (server_cookie != NULL) { - hprintf("%s\n", server_cookie); + stuff_to_cookie(cookie, 1024, + WCC->wc_session, + WCC->wc_username, + WCC->wc_password, + WCC->wc_roomname, + get_selected_language() + ); + + if (unset_cookies) { + hprintf("Set-cookie: webcit=%s; path=/\r\n", unset); + } else { + hprintf("Set-cookie: webcit=%s; path=/\r\n", cookie); + if (server_cookie != NULL) { + hprintf("%s\n", server_cookie); + } } } @@ -254,7 +257,7 @@ void http_transmit_thing(const char *content_type, #ifndef TECH_PREVIEW lprintf(9, "http_transmit_thing(%s)%s\n", content_type, - (is_static ? " (static)" : "") + ((is_static > 0) ? " (static)" : "") ); #endif output_headers(0, 0, 0, 0, 0, is_static); -- 2.30.2