[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp
Pranav Kant
pranavk at collabora.co.uk
Tue Nov 1 09:26:34 UTC 2016
loolwsd/LOOLWSD.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 86383d40db00931243c9c2c85655aaee30558de3
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Tue Nov 1 10:25:29 2016 +0100
loolwsd: Tentative fix for 'Address already in use'
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 3956e29..1eb68e3 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -65,6 +65,7 @@
#include <Poco/Net/HTTPServerRequest.h>
#include <Poco/Net/HTTPServerResponse.h>
#include <Poco/Net/InvalidCertificateHandler.h>
+#include <Poco/Net/IPAddress.h>
#include <Poco/Net/KeyConsoleHandler.h>
#include <Poco/Net/MessageHeader.h>
#include <Poco/Net/NameValueCollection.h>
@@ -1317,8 +1318,11 @@ static inline ServerSocket* getServerSocket(int nClientPortNumber)
try
{
ServerSocket* socket = LOOLWSD::isSSLEnabled() ? new SecureServerSocket() : new ServerSocket();
- socket->bind(nClientPortNumber, false);
-
+ Poco::Net::IPAddress wildcardAddr;
+ SocketAddress address(wildcardAddr, nClientPortNumber);
+ socket->init(address.af());
+ socket->setReuseAddress(true);
+ socket->bind(address, false);
// 64 is the default value for the backlog parameter in Poco
// when creating a ServerSocket, so use it here, too.
socket->listen(64);
More information about the Libreoffice-commits
mailing list