* output_headers musn't lean on having a server connection...
authorWilfried Göesgens <willi@citadel.org>
Tue, 10 Feb 2009 22:15:29 +0000 (22:15 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 10 Feb 2009 22:15:29 +0000 (22:15 +0000)
webcit/webcit.c

index edc19a0c6422ec9079ed8edd56833871d90a4b65..6715fe4836a5d0537be72426a8b8b5ca631c663b 100644 (file)
@@ -116,12 +116,17 @@ void output_headers(      int do_httpheaders,     /* 1 = output HTTP headers
        http_datestring(httpnow, sizeof httpnow, time(NULL));
 
        if (do_httpheaders) {
-               hprintf("Content-type: text/html; charset=utf-8\r\n"
-                       "Server: %s / %s\n"
-                       "Connection: close\r\n",
-                       PACKAGE_STRING, 
-                       ChrPtr(WCC->serv_info->serv_software)
-               );
+               if (WCC->serv_info != NULL)
+                       hprintf("Content-type: text/html; charset=utf-8\r\n"
+                               "Server: %s / %s\n"
+                               "Connection: close\r\n",
+                               PACKAGE_STRING, 
+                               ChrPtr(WCC->serv_info->serv_software));
+               else
+                       hprintf("Content-type: text/html; charset=utf-8\r\n"
+                               "Server: %s / [n/a]\n"
+                               "Connection: close\r\n",
+                               PACKAGE_STRING);
        }
 
        if (cache) {