* don't send cookies with static data; we don't know what to put in them here.
authorWilfried Göesgens <willi@citadel.org>
Thu, 21 May 2009 22:46:28 +0000 (22:46 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 21 May 2009 22:46:28 +0000 (22:46 +0000)
webcit/context_loop.c
webcit/static.c
webcit/webcit.c

index 93e7a5f824ee925aa1e66ee5c117c9f5ccac57cb..de41b1dba2f4b4c107151dd8385f151d29aec8e9 100644 (file)
@@ -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
index 7e5580b273400c188ce13bbfedd959ee3f398041..e432d53edd5796496ebdb76c280673812778324f 100644 (file)
@@ -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();
index 7531ac49e53f3fc6b7e1750e0b087e61d42ef05d..680003e2f56a988354663f91cbb7347d81896942 100644 (file)
@@ -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);