* Properly handle '551 too many users' error in WebCit. This resolves bug 420.
authorArt Cancro <ajc@citadel.org>
Mon, 12 Jan 2009 21:47:52 +0000 (21:47 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 12 Jan 2009 21:47:52 +0000 (21:47 +0000)
webcit/webcit.c

index 2be182799aeef85f603c2eca3510db0ef82c7ca7..6cecbe7d6723e9d4881bccadc4ea5b35e75a543e 100644 (file)
@@ -804,9 +804,17 @@ void session_loop(HashList *HTTPHeaders, StrBuf *ReqLine, StrBuf *request_method
                }
                else {
                        WCC->connected = 1;
-                       serv_getln(buf, sizeof buf);    /** get the server welcome message */
+                       serv_getln(buf, sizeof buf);    /* get the server greeting */
 
-                       /**
+                       /* Are there too many users already logged in? */
+                       if (!strncmp(buf, "571", 3)) {
+                               wprintf(_("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."));
+                               end_burst();
+                               end_webcit_session();
+                               goto SKIP_ALL_THIS_CRAP;
+                       }
+
+                       /*
                         * From what host is our user connecting?  Go with
                         * the host at the other end of the HTTP socket,
                         * unless we are following X-Forwarded-For: headers