]> code.citadel.org Git - citadel.git/blobdiff - webcit/static.c
Revert "No more robots.txt, we now welcome spiders"
[citadel.git] / webcit / static.c
index 461f3abbffff7efca0dcff3fc81bbb7767995a7c..46770bf1220de5bec6d05e2d02b291bc66262715 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: webcit.c 7459 2009-05-17 08:34:33Z dothebart $
- *
  * This is the main transaction loop of the web service.  It maintains a
  * persistent session to the Citadel server, handling HTTP WebCit requests as
  * they arrive and presenting a user interface.
@@ -26,7 +24,7 @@ HashList *StaticFilemappings[4] = {NULL, NULL, NULL, NULL};
                        lprintf(9, "Suspicious request. Ignoring.");
                        hprintf("HTTP/1.1 404 Security check failed\r\n");
                        hprintf("Content-Type: text/plain\r\n\r\n");
-                       wprintf("You have sent a malformed or invalid request.\r\n");
+                       wc_printf("You have sent a malformed or invalid request.\r\n");
                        end_burst();
                }
 */
@@ -49,7 +47,7 @@ void output_static(const char *what)
                hprintf("HTTP/1.1 404 %s\r\n", strerror(errno));
                hprintf("Content-Type: text/plain\r\n");
                begin_burst();
-               wprintf("Cannot open %s: %s\r\n", what, strerror(errno));
+               wc_printf("Cannot open %s: %s\r\n", what, strerror(errno));
                end_burst();
        } else {
                len = strlen (what);
@@ -60,7 +58,7 @@ void output_static(const char *what)
                        hprintf("HTTP/1.1 404 %s\r\n", strerror(errno));
                        hprintf("Content-Type: text/plain\r\n");
                        begin_burst();
-                       wprintf("Cannot fstat %s: %s\n", what, strerror(errno));
+                       wc_printf("Cannot fstat %s: %s\n", what, strerror(errno));
                        end_burst();
                        return;
                }
@@ -225,6 +223,8 @@ void output_flat_static(void)
        void *vFile;
        StrBuf *File;
 
+       if (WCC->Hdr->HR.Handler == NULL)
+               return;
        if (GetHash(StaticFilemappings[0], SKEY(WCC->Hdr->HR.Handler->Name), &vFile) &&
            (vFile != NULL))
        {