[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - kit/Kit.cpp net/ServerSocket.hpp net/Socket.cpp wsd/LOOLWSD.cpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Apr 29 11:05:16 UTC 2019


 kit/Kit.cpp          |    2 +-
 net/ServerSocket.hpp |    4 ++++
 net/Socket.cpp       |   23 ++++++++++-------------
 wsd/LOOLWSD.cpp      |    2 ++
 4 files changed, 17 insertions(+), 14 deletions(-)

New commits:
commit e5499d27536237aae9be1a436339230934284285
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Apr 29 10:35:00 2019 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Apr 29 14:03:10 2019 +0300

    Fix build in the MOBILEAPP case
    
    Even with this fix, at least the iOS app doesn't work properly when
    built from HEAD of this branch and of the cp-6.0 branch, though. At
    least combo boxes in tunnelled dialogs don't work any longer.

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 48bccf106..2cc114422 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -2463,7 +2463,7 @@ void lokit_main(
 #ifndef MOBILEAPP
         mainKit.insertNewUnixSocket(MasterLocation, pathAndQuery, websocketHandler);
 #else
-        mainKit.insertNewFakeSocketSync(docBrokerSocket, websocketHandler);
+        mainKit.insertNewFakeSocket(docBrokerSocket, websocketHandler);
 #endif
 
         LOG_INF("New kit client websocket inserted.");
diff --git a/net/ServerSocket.hpp b/net/ServerSocket.hpp
index 1b1f10fb9..f91e3a505 100644
--- a/net/ServerSocket.hpp
+++ b/net/ServerSocket.hpp
@@ -96,6 +96,8 @@ protected:
     std::shared_ptr<SocketFactory> _sockFactory;
 };
 
+#ifndef MOBILEAPP
+
 /// A non-blocking, streaming Unix Domain Socket for local use
 class LocalServerSocket : public ServerSocket
 {
@@ -114,4 +116,6 @@ private:
 
 #endif
 
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/net/Socket.cpp b/net/Socket.cpp
index f3492c37f..16d609f3b 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -201,6 +201,8 @@ void SocketPoll::wakeupWorld()
         wakeup(fd);
 }
 
+#ifndef MOBILEAPP
+
 void SocketPoll::insertNewWebSocketSync(
     const Poco::URI &uri,
     const std::shared_ptr<SocketHandlerInterface>& websocketHandler)
@@ -332,7 +334,8 @@ void SocketPoll::insertNewUnixSocket(
     }
 }
 
-#ifdef MOBILEAPP
+#else
+
 void SocketPoll::insertNewFakeSocket(
     int peerSocket,
     const std::shared_ptr<SocketHandlerInterface>& websocketHandler)
@@ -362,6 +365,7 @@ void SocketPoll::insertNewFakeSocket(
         }
     }
 }
+
 #endif
 
 void ServerSocket::dumpState(std::ostream& os)
@@ -490,7 +494,7 @@ std::shared_ptr<Socket> ServerSocket::accept()
 {
     // Accept a connection (if any) and set it to non-blocking.
     // There still need the client's address to filter request from POST(call from REST) here.
-#if !MOBILEAPP
+#ifndef MOBILEAPP
     assert(_type != Socket::Type::Unix);
 
     struct sockaddr_in6 clientInfo;
@@ -507,7 +511,7 @@ std::shared_ptr<Socket> ServerSocket::accept()
         {
             std::shared_ptr<Socket> _socket = _sockFactory->create(rc);
 
-#if !MOBILEAPP
+#ifndef MOBILEAPP
             char addrstr[INET6_ADDRSTRLEN];
 
             const void *inAddr;
@@ -540,6 +544,8 @@ std::shared_ptr<Socket> ServerSocket::accept()
     return nullptr;
 }
 
+#ifndef MOBILEAPP
+
 int Socket::getPid() const
 {
     struct ucred creds;
@@ -554,11 +560,7 @@ int Socket::getPid() const
 
 std::shared_ptr<Socket> LocalServerSocket::accept()
 {
-#if !MOBILEAPP
     const int rc = ::accept4(getFD(), nullptr, nullptr, SOCK_NONBLOCK);
-#else
-    const int rc = fakeSocketAccept4(getFD());
-#endif
     try
     {
         LOG_DBG("Accepted prisoner socket #" << rc << ", creating socket object.");
@@ -566,7 +568,6 @@ std::shared_ptr<Socket> LocalServerSocket::accept()
             return std::shared_ptr<Socket>(nullptr);
 
         std::shared_ptr<Socket> _socket = _sockFactory->create(rc);
-#if MOBILEAPP
         // Sanity check this incoming socket
         struct ucred creds;
         socklen_t credSize = sizeof(struct ucred);
@@ -592,7 +593,6 @@ std::shared_ptr<Socket> LocalServerSocket::accept()
 
         LOG_DBG("Accepted socket is UDS - address " << addr <<
                 " and pid/gid " << creds.pid << "/" << creds.gid);
-#endif
         return _socket;
     }
     catch (const std::exception& ex)
@@ -605,7 +605,6 @@ std::shared_ptr<Socket> LocalServerSocket::accept()
 /// Returns true on success only.
 std::string LocalServerSocket::bind()
 {
-#ifndef MOBILEAPP
     int rc;
     struct sockaddr_un addrunix;
     do
@@ -625,12 +624,10 @@ std::string LocalServerSocket::bind()
 
     if (rc >= 0)
         return std::string(&addrunix.sun_path[1]);
-#endif
+
     return "";
 }
 
-#ifndef MOBILEAPP
-
 bool StreamSocket::parseHeader(const char *clientName,
                                Poco::MemoryInputStream &message,
                                Poco::Net::HTTPRequest &request,
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 7a7dfed54..1dd17d8b9 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2924,12 +2924,14 @@ public:
         SocketPoll::InhibitThreadChecks = true;
 
         os << "LOOLWSDServer:\n"
+#ifndef MOBILEAPP
            << "  Ports: server " << ClientPortNumber
            <<          " prisoner " << MasterLocation << "\n"
            << "  SSL: " << (LOOLWSD::isSSLEnabled() ? "https" : "http") << "\n"
            << "  SSL-Termination: " << (LOOLWSD::isSSLTermination() ? "yes" : "no") << "\n"
            << "  Security " << (LOOLWSD::NoCapsForKit ? "no" : "") << " chroot, "
                             << (LOOLWSD::NoSeccomp ? "no" : "") << " api lockdown\n"
+#endif
            << "  TerminationFlag: " << TerminationFlag << "\n"
            << "  isShuttingDown: " << ShutdownRequestFlag << "\n"
            << "  NewChildren: " << NewChildren.size() << "\n"


More information about the Libreoffice-commits mailing list