loolwsd/LOOLWSD.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 7a1d02a7cea88e0d4c423acac669e58d2ae15d68
Author: Henry Castro <hcas...@collabora.com>
Date:   Wed Sep 28 18:07:50 2016 -0400

    loolwsd: MAX_CONNECTIONS, should send HTTP status code
    
    It is not necessary to throw a WebSocketException

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 951a927..aa45795 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -862,7 +862,10 @@ public:
         {
             --LOOLWSD::NumConnections;
             Log::error("Maximum number of connections reached.");
-            throw 
WebSocketErrorMessageException(Poco::format(SERVICE_UNAVALABLE_LIMIT_REACHED, 
MAX_DOCUMENTS, MAX_CONNECTIONS, std::string(LOOLWSD_PRODUCT), 
std::string(LOOLWSD_URL), std::string(LOOLWSD_URL)));
+            response.setStatusAndReason(HTTPResponse::HTTP_NOT_ACCEPTABLE, 
Poco::format(SERVICE_UNAVALABLE_LIMIT_REACHED, MAX_DOCUMENTS, MAX_CONNECTIONS, 
std::string(LOOLWSD_PRODUCT), std::string(LOOLWSD_URL), 
std::string(LOOLWSD_URL)));
+            response.setContentLength(0);
+            response.send();
+            return;
         }
 #endif
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to