kit/Kit.cpp | 11 +++++++++-- net/Socket.hpp | 1 + wsd/DocumentBroker.hpp | 3 +-- 3 files changed, 11 insertions(+), 4 deletions(-)
New commits: commit d4e08350431a7662eef22a21b5b0fede226ae0e6 Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Thu Mar 12 22:17:05 2020 +0200 Commit: Tor Lillqvist <t...@collabora.com> CommitDate: Fri Mar 13 00:28:19 2020 +0100 Make closing the document work again in the iOS (and Android?) app But opening a second document now hangs. Sigh, the plumbing in the mobile apps is so extremely fragile. But that is to be expected when turning a multi-process structure (where one class of processes exit as soon as they have done their job) into a single process running forever. Change-Id: I0fdb751f44e16efb42843189969e049bf14816f0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90443 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tor Lillqvist <t...@collabora.com> diff --git a/kit/Kit.cpp b/kit/Kit.cpp index f8c76a06a..8e2b2ddc5 100644 --- a/kit/Kit.cpp +++ b/kit/Kit.cpp @@ -2149,14 +2149,21 @@ protected: LOG_DBG("CreateSession failed."); } } -#if !MOBILEAPP + else if (tokens.equals(0, "exit")) { +#if !MOBILEAPP LOG_INF("Terminating immediately due to parent 'exit' command."); Log::shutdown(); std::_Exit(EX_SOFTWARE); - } +#else + LOG_INF("Setting TerminationFlag due to 'exit' command."); + SigUtil::setTerminationFlag(); + + // Not really a logic error, but hey. This is expected to be caught in SocketPoll::poll(). + throw std::logic_error("exit"); #endif + } else if (tokens.equals(0, "tile") || tokens.equals(0, "tilecombine") || tokens.equals(0, "canceltiles") || tokens.equals(0, "paintwindow") || tokens.equals(0, "resizewindow") || LOOLProtocol::getFirstToken(tokens[0], '-') == "child") diff --git a/net/Socket.hpp b/net/Socket.hpp index 5427b99fa..1e632516e 100644 --- a/net/Socket.hpp +++ b/net/Socket.hpp @@ -673,6 +673,7 @@ public: LOG_ERR("Error while handling poll for socket #" << _pollFds[i].fd << " in " << _name << ": " << exc.what()); disposition.setClosed(); + rc = -1; } if (disposition.isMove() || disposition.isClosed()) diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp index 7096afd4c..68369d274 100644 --- a/wsd/DocumentBroker.hpp +++ b/wsd/DocumentBroker.hpp @@ -108,7 +108,6 @@ public: try { -#if !MOBILEAPP // There is no "child process" in a mobile app LOG_DBG("Closing ChildProcess [" << _pid << "]."); // Request the child to exit @@ -117,7 +116,7 @@ public: LOG_DBG("Stopping ChildProcess [" << _pid << "] by sending 'exit' command."); sendTextFrame("exit"); } -#endif + // Shutdown the socket. if (_ws) _ws->shutdown(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits