* abort if we're not able to retrieve the citserver information instead of crashing...
authorWilfried Göesgens <willi@citadel.org>
Sat, 18 Apr 2009 12:09:55 +0000 (12:09 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 18 Apr 2009 12:09:55 +0000 (12:09 +0000)
webcit/webcit.c

index 00afe8eb590abcc4448beacf5b54ef7ab682bd1f..21dfdd3919d4dec585949c0cddc70d5897e01cbb 100644 (file)
@@ -837,6 +837,16 @@ void session_loop(HashList *HTTPHeaders, StrBuf *ReqLine, StrBuf *request_method
                        }
                        if (WCC->serv_info == NULL)
                                WCC->serv_info = get_serv_info(browser_host, user_agent);
+                       if (WCC->serv_info == NULL){
+                               begin_burst();
+                               wprintf(_("Received unexpected answer from Citadel "
+                                         "server; bailing out."));
+                               hprintf("HTTP/1.1 200 OK\r\n");
+                               hprintf("Content-type: text/plain; charset=utf-8\r\n");
+                               end_burst();
+                               end_webcit_session();
+                               goto SKIP_ALL_THIS_CRAP;
+                       }
                        if (WCC->serv_info->serv_rev_level < MINIMUM_CIT_VERSION) {
                                begin_burst();
                                wprintf(_("You are connected to a Citadel "