When we 503, do it in HTML
authorArt Cancro <ajc@citadel.org>
Tue, 11 Jan 2011 03:53:12 +0000 (22:53 -0500)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 11:18:37 +0000 (11:18 +0000)
Conflicts:

webcit/webcit.c

citadel/modules/wiki/serv_wiki.c
webcit/webcit.c

index abaa71e1f5db374099f9c3d3c017678110e58e9d..5f1845757560a1604cad5596708e536d1915085e 100644 (file)
@@ -422,7 +422,8 @@ void wiki_rev_callback(char *name, char *filename, char *partnum, char *disp,
        CtdlLogPrintf(CTDL_DEBUG, "callback found rev: %s\n", this_rev);
 
        /* Perform the patch */
-       fp = popen("patch -f -s -p0 --global-reject-file=/dev/null >/dev/null 2>/dev/null", "w");
+       //fp = popen("patch -f -s -p0 --global-reject-file=/dev/null >/dev/null 2>/dev/null", "w");
+       fp = popen("patch -f -s -p0 --global-reject-file=/dev/null >/dev/null 2>>/tmp/patcherr.txt", "w");
        if (fp) {
                /* Replace the filenames in the patch with the tempfilename we're actually tweaking */
                fprintf(fp, "--- %s\n", hecbd->tempfilename);
index a234824210c9cba351648a4b078ecaf3d03dcf89..8f51833deb32a180f9ebced1bc9ddc3177a9c016 100644 (file)
@@ -657,7 +657,17 @@ void session_loop(void)
         * connection now.
         */
        if (!WCC->connected) {
-               if (GetConnected ())
+               if (GetConnected()) {
+                       hprintf("HTTP/1.1 503 Service Unavailable\r\n");
+                       hprintf("Content-Type: text/html\r\n");
+                       begin_burst();
+                       wc_printf("<html><head><title>503 Service Unavailable</title></head><body>\n");
+                       wc_printf(_("This program was unable to connect or stay "
+                               "connected to the Citadel server.  Please report "
+                               "this problem to your system administrator.")
+                       );
+                       wc_printf("</body></html>\n");
+                       end_burst();
                        goto SKIP_ALL_THIS_CRAP;
        }