From 8be46952a09923e6b85131d8e5a679e9c11ea9af Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 20 Sep 2010 00:19:18 -0400 Subject: [PATCH] Issue HTTP 502 and 503 errors instead of 200 followed by an error message, when appropriate --- webcit/serv_func.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 77b12888a..e812de381 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -183,6 +183,8 @@ int GetConnected (void) /* Server isn't ready for us? */ if (short_status != 2) { if (Status == 571) { + hprintf("HTTP/1.1 503 Service Unavailable\r\n"); + hprintf("Content-type: text/plain; charset=utf-8\r\n"); wc_printf(_("This server is already serving its maximum number of users and cannot accept any additional logins at this time. Please try again later or contact your system administrator.")); } else { @@ -190,6 +192,8 @@ int GetConnected (void) Status, _("Received unexpected answer from Citadel server; bailing out.") ); + hprintf("HTTP/1.1 502 Bad Gateway\r\n"); + hprintf("Content-type: text/plain; charset=utf-8\r\n"); } end_burst(); end_webcit_session(); @@ -218,7 +222,7 @@ int GetConnected (void) if (WCC->serv_info == NULL){ begin_burst(); wc_printf(_("Received unexpected answer from Citadel server; bailing out.")); - hprintf("HTTP/1.1 200 OK\r\n"); + hprintf("HTTP/1.1 502 Bad Gateway\r\n"); hprintf("Content-type: text/plain; charset=utf-8\r\n"); end_burst(); end_webcit_session(); -- 2.30.2