]> code.citadel.org Git - citadel.git/blobdiff - webcit/context_loop.c
* Fix '/*' found in comment
[citadel.git] / webcit / context_loop.c
index a3b47acad173a49913fd3590af4bce3a2d97bb69..3a20c7e82092a54a283457151b3d3862b188fe4f 100644 (file)
@@ -367,7 +367,7 @@ int ReadHTTPRequest (ParsedHttpHdrs *Hdr)
        LastLine = NULL;
        do {
                nLine ++;
-               Line = NewStrBuf();
+               Line = NewStrBufPlain(NULL, SIZ / 4);
 
                if (ClientGetLine(Hdr, Line) < 0) return 1;
 
@@ -543,8 +543,10 @@ void context_loop(ParsedHttpHdrs *Hdr)
                TheSession = CreateSession(1, &SessionList, Hdr, &SessionListMutex);
 
                if ((StrLength(Hdr->c_username) == 0) &&
-                   (!Hdr->HR.DontNeedAuth))
+                   (!Hdr->HR.DontNeedAuth)) {
                        OverrideRequest(Hdr, HKEY("GET /static/nocookies.html?force_close_session=yes HTTP/1.0"));
+                       Hdr->HR.prohibit_caching = 1;
+               }
                
                if (StrLength(Hdr->c_language) > 0) {
                        lprintf(9, "Session cookie requests language '%s'\n", ChrPtr(Hdr->c_language));
@@ -771,8 +773,8 @@ InitModule_CONTEXT
  * Look for commonly-found probes of malware such as worms, viruses, trojans, and Microsoft Office.
  * Short-circuit these requests so we don't have to send them through the full processing loop.
  */
-       WebcitAddUrlHandler(HKEY("scripts"), do_404, ANONYMOUS|BOGUS); /* /root.exe     /* Worms and trojans and viruses, oh my! */
-       WebcitAddUrlHandler(HKEY("c"), do_404, ANONYMOUS|BOGUS);        /* /winnt */
+       WebcitAddUrlHandler(HKEY("scripts"), do_404, ANONYMOUS|BOGUS);          /* /root.exe - Worms and trojans and viruses, oh my! */
+       WebcitAddUrlHandler(HKEY("c"), do_404, ANONYMOUS|BOGUS);                /* /winnt */
        WebcitAddUrlHandler(HKEY("MSADC"), do_404, ANONYMOUS|BOGUS);
        WebcitAddUrlHandler(HKEY("_vti"), do_404, ANONYMOUS|BOGUS);             /* Broken Microsoft DAV implementation */
        WebcitAddUrlHandler(HKEY("MSOffice"), do_404, ANONYMOUS|BOGUS);         /* Stoopid MSOffice thinks everyone is IIS */
@@ -784,8 +786,8 @@ void
 HttpNewModule_CONTEXT
 (ParsedHttpHdrs *httpreq)
 {
-       httpreq->PlainArgs = NewStrBuf();
-       httpreq->this_page = NewStrBuf();
+       httpreq->PlainArgs = NewStrBufPlain(NULL, SIZ);
+       httpreq->this_page = NewStrBufPlain(NULL, SIZ);
 }
 
 void