[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

Henry Castro hcastro at collabora.com
Wed Sep 28 22:10:12 UTC 2016


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

New commits:
commit 7a1d02a7cea88e0d4c423acac669e58d2ae15d68
Author: Henry Castro <hcastro at 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
 


More information about the Libreoffice-commits mailing list