503 Service Unavailable when we can't connect to citserver
authorArt Cancro <ajc@citadel.org>
Fri, 31 Dec 2010 19:50:52 +0000 (14:50 -0500)
committerArt Cancro <ajc@citadel.org>
Fri, 31 Dec 2010 19:50:52 +0000 (14:50 -0500)
webcit/serv_func.c
webcit/webcit.c

index 8585744af915c810dfe857cc6223457feac72127..6a53a36781932b2271b31d3c74c8594046e52762 100644 (file)
@@ -167,7 +167,6 @@ int GetConnected (void)
                WCC->serv_sock = tcp_connectsock(ctdlhost, ctdlport);
        
        if (WCC->serv_sock < 0) {
-               do_logout();
                FreeStrBuf(&WCC->ReadBuf);
                return 1;
        }
index c04393fd8a8f94a716c2d008a79eccb793420cf0..8583196092018494a5ea1d201d9649f1399df762 100644 (file)
@@ -651,8 +651,15 @@ 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/plain\r\n");
+                       begin_burst();
+                       wc_printf("%s", _("This program was unable to connect or stay connected to the Citadel server.  "
+                               "Please report this problem to your system administrator."));
+                       end_burst();
                        goto SKIP_ALL_THIS_CRAP;
+               }
        }