[Libreoffice-commits] core.git: icon-themes/breeze icon-themes/galaxy icon-themes/industrial icon-themes/tango
dev/null |binary icon-themes/breeze/cmd/lc_smallcaps.png |binary icon-themes/galaxy/cmd/lc_smallcaps.png |binary icon-themes/galaxy/cmd/sc_smallcaps.png |binary icon-themes/galaxy/res/templatestar.png |binary icon-themes/industrial/README|8 -- icon-themes/tango/cmd/lc_adddirect.png |binary icon-themes/tango/cmd/lc_drawcaption.png |binary icon-themes/tango/cmd/lc_mergedialog.png |binary icon-themes/tango/cmd/lc_presentationlayout.png |binary icon-themes/tango/cmd/lc_printersetup.png|binary icon-themes/tango/cmd/lc_printersetup.xcf.bz2|binary icon-themes/tango/cmd/lc_recsave.png |binary icon-themes/tango/cmd/lc_rehearsetimings.png |binary icon-themes/tango/cmd/sc_adddirect.png |binary icon-themes/tango/cmd/sc_drawcaption.png |binary icon-themes/tango/cmd/sc_mergedialog.png |binary icon-themes/tango/cmd/sc_optionstreedialog.png |binary icon-themes/tango/cmd/sc_presentationlayout.png |binary icon-themes/tango/cmd/sc_printersetup.png|binary icon-themes/tango/cmd/sc_printersetup.xcf.bz2|binary icon-themes/tango/cmd/sc_recsave.png |binary icon-themes/tango/cmd/sc_rehearsetimings.png |binary icon-themes/tango/cmd/sc_toggleobjectrotatemode.png |binary icon-themes/tango/cmd/sc_toggleobjectrotatemode.svg | 61 ++- icon-themes/tango/framework/res/remote-documents.png |binary icon-themes/tango/res/helpimg/note.png |binary icon-themes/tango/res/helpimg/tip.png|binary icon-themes/tango/res/helpimg/warning.png|binary icon-themes/tango/res/hldocntp.png |binary icon-themes/tango/res/hldoctp.png|binary icon-themes/tango/res/hldoctp.xcf|binary icon-themes/tango/res/hlinettp.png |binary icon-themes/tango/res/hlmailtp.png |binary icon-themes/tango/res/im30820.png|binary icon-themes/tango/res/im30826.png|binary icon-themes/tango/res/lx03123.png|binary icon-themes/tango/res/lx03126.png|binary icon-themes/tango/res/lx03127.png|binary icon-themes/tango/res/lx03130.png|binary icon-themes/tango/res/sc05678.png|binary icon-themes/tango/res/sx03130.png|binary icon-themes/tango/res/sx03160.png|binary icon-themes/tango/res/sx03162.png|binary icon-themes/tango/res/sx03163.png|binary 45 files changed, 47 insertions(+), 22 deletions(-) New commits: commit 2559ab66fd2976df54fc7d66bac5b7c0f7c23370 Author: Adolfo Jayme Barrientos Date: Mon Nov 14 00:32:36 2016 -0600 Tango icon update Change-Id: Id8f14eb9a2b38e35d1147cea49413953f752472b diff --git a/icon-themes/breeze/cmd/lc_smallcaps.png b/icon-themes/breeze/cmd/lc_smallcaps.png new file mode 100644 index 000..7ef20ce Binary files /dev/null and b/icon-themes/breeze/cmd/lc_smallcaps.png differ diff --git a/icon-themes/galaxy/cmd/lc_smallcaps.png b/icon-themes/galaxy/cmd/lc_smallcaps.png index 7ef20ce..c01c81d10 100644 Binary files a/icon-themes/galaxy/cmd/lc_smallcaps.png and b/icon-themes/galaxy/cmd/lc_smallcaps.png differ diff --git a/icon-themes/galaxy/cmd/sc_smallcaps.png b/icon-themes/galaxy/cmd/sc_smallcaps.png index eaf4101..395e0bf 100644 Binary files a/icon-themes/galaxy/cmd/sc_smallcaps.png and b/icon-themes/galaxy/cmd/sc_smallcaps.png differ diff --git a/icon-themes/galaxy/res/templatestar.png b/icon-themes/galaxy/res/templatestar.png index 96bf3cb..870faff 100644 Binary files a/icon-themes/galaxy/res/templatestar.png and b/icon-themes/galaxy/res/templatestar.png differ diff --git a/icon-themes/industrial/README b/icon-themes/industrial/README index 6b25f9a..a736cde 100644 --- a/icon-themes/industrial/README +++ b/icon-themes/industrial/README @@ -131,7 +131,6 @@ cmd/lc_definename.png cmd/lc_deleterecord.png cmd/lc_diagramdata.png cmd/lc_doubleclicktextedit.png -cmd/lc_drawcaption.png cmd/lc_dsbdocumentdatasource.png cmd/lc_dsbeditdoc.png cmd/lc_dsbformletter.png @@ -295,7 +294,6 @@ cmd/lc_macrorecorder.png cmd/lc_managebreakpoints.png cmd/lc_matchgroup.png cmd/lc_measureline.png -cmd/lc_mergedialog.png cmd/lc_modifypage.png cmd/lc_moduledialog.png cmd/lc_morecontrols.png @@ -324,10 +322,8 @@ cmd/lc_progressbar.png cmd/lc_pushbutton.png cmd/lc_quickedit.png cmd/lc_radiobutton.png -cmd/lc_recsave.png cmd/lc_rect_rounded_unfilled.png cmd/lc_rect_unfilled.png -cmd/lc_rehearsetimings.png cmd/lc_removefilter.png cmd/lc_removefiltersort.png cmd/lc_repeat.png @@ -495,7 +491,6 @@ cmd/sc_diagramdata.png cmd/sc_diaspeed.png cmd/sc_
[Libreoffice-commits] core.git: starmath/source
starmath/source/dialog.cxx | 33 +++-- 1 file changed, 3 insertions(+), 30 deletions(-) New commits: commit c5f5b3e5334c52502c1de28828a44ad469c68850 Author: melikeyurtoglu Date: Sun Nov 13 20:15:36 2016 +0200 tdf#91222 VclBuilder constructor cleanup Change-Id: I29a8ca55d1d9f319cd57e5e30fa7e58e4d91dc5c Signed-off-by: melikeyurtoglu Reviewed-on: https://gerrit.libreoffice.org/30810 Reviewed-by: Noel Grandin Tested-by: Noel Grandin diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index d4f3192..3dd2f919 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -277,16 +277,7 @@ void SmShowFont::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRec (rRenderContext.GetOutputSize().Height() - aTextSize.Height()) / 2), sText); } -VCL_BUILDER_DECL_FACTORY(SmShowFont) -{ -WinBits nWinStyle = 0; - -OString sBorder = VclBuilder::extractCustomProperty(rMap); -if (!sBorder.isEmpty()) -nWinStyle |= WB_BORDER; - -rRet = VclPtr::Create(pParent, nWinStyle); -} +VCL_BUILDER_FACTORY_CONSTRUCTOR(SmShowFont, 0) Size SmShowFont::GetOptimalSize() const { @@ -1351,16 +1342,7 @@ IMPL_LINK( SmShowSymbolSetWindow, ScrollHdl, ScrollBar*, /*pScrollBar*/, void) Invalidate(); } -VCL_BUILDER_DECL_FACTORY(SmShowSymbol) -{ -WinBits nWinStyle = 0; - -OString sBorder = VclBuilder::extractCustomProperty(rMap); -if (!sBorder.isEmpty()) -nWinStyle |= WB_BORDER; - -rRet = VclPtr::Create(pParent, nWinStyle); -} +VCL_BUILDER_FACTORY_CONSTRUCTOR(SmShowSymbol, 0) void SmShowSymbol::Resize() { @@ -1637,16 +1619,7 @@ const SmSym* SmSymbolDialog::GetSymbol() const return bValid ? aSymbolSet[ nSymbolNo ] : nullptr; } -VCL_BUILDER_DECL_FACTORY(SmShowChar) -{ -WinBits nWinStyle = 0; - -OString sBorder = VclBuilder::extractCustomProperty(rMap); -if (!sBorder.isEmpty()) -nWinStyle |= WB_BORDER; - -rRet = VclPtr::Create(pParent, nWinStyle); -} +VCL_BUILDER_FACTORY_CONSTRUCTOR(SmShowChar, 0) void SmShowChar::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/Util.cpp
loolwsd/Util.cpp | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) New commits: commit 303d173ae10348433f9b0b845267a317cb69eff6 Author: Ashod Nakashian Date: Mon Nov 14 00:09:26 2016 -0500 loolwsd: gracefully shutdown on first CTRL+C then force termination on second Change-Id: I1c84663d10de8ece715a296eec284b74cdda69df Reviewed-on: https://gerrit.libreoffice.org/30834 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp index 2bc780c..11d19d1 100644 --- a/loolwsd/Util.cpp +++ b/loolwsd/Util.cpp @@ -199,14 +199,23 @@ namespace Util static void handleTerminationSignal(const int signal) { -if (!TerminationFlag) +if (!ShutdownFlag) { -TerminationFlag = true; +Log::signalLogPrefix(); +Log::signalLog(" Shutdown signal received: "); +Log::signalLog(signalName(signal)); +Log::signalLog("\n"); +ShutdownFlag = true; +return; +} +if (!TerminationFlag) +{ Log::signalLogPrefix(); -Log::signalLog(" Termination signal received: "); +Log::signalLog(" Forced-Termination signal received: "); Log::signalLog(signalName(signal)); Log::signalLog("\n"); +TerminationFlag = true; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp
loolwsd/LOOLWSD.cpp |3 +++ 1 file changed, 3 insertions(+) New commits: commit d36306e347ae6b3ed82971a52dca9f6b639c4a42 Author: Ashod Nakashian Date: Mon Nov 14 00:08:38 2016 -0500 loolwsd: broadcast that the server is shutting down Change-Id: Ib94eb991763094cd6fe0ab36636f48f9844586c5 Reviewed-on: https://gerrit.libreoffice.org/30833 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 4bd22bb..2d2c15a 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -2076,6 +2076,7 @@ int LOOLWSD::main(const std::vector& /*args*/) // Stop the listening to new connections // and wait until sockets close. LOG_INF("Stopping server socket listening."); +Util::alertAllUsers("internal", "shutdown"); srv.stop(); srv2.stop(); threadPool.joinAll(); @@ -2143,6 +2144,8 @@ void alertAllUsers(const std::string& cmd, const std::string& kind) { std::lock_guard DocBrokersLock(DocBrokersMutex); +LOG_INF("Alerting all users: cmd=" << cmd << ", kind=" << kind); + for (auto& brokerIt : DocBrokers) { auto lock = brokerIt.second->getLock(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/dist loleaflet/src
loleaflet/dist/admin/adminSettings.html|2 ++ loleaflet/src/admin/AdminSocketSettings.js | 10 ++ 2 files changed, 12 insertions(+) New commits: commit da5ef9b5a29d6373cf4eb0767fae3e3a33698f5d Author: Ashod Nakashian Date: Sun Nov 13 23:55:47 2016 -0500 loleaflet: add shutdown command to the admin settings When we add more server controls (restart, f.e.) we will need to move this to a separate page. Also, we need to prompt the admin for reason, which we can broadcast to all users when the server goes down. Change-Id: Ide92e58b5b64a5107b6556aef6b1a88191d5d21b Reviewed-on: https://gerrit.libreoffice.org/30832 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loleaflet/dist/admin/adminSettings.html b/loleaflet/dist/admin/adminSettings.html index 94ba5b2..d860de2 100644 --- a/loleaflet/dist/admin/adminSettings.html +++ b/loleaflet/dist/admin/adminSettings.html @@ -73,6 +73,8 @@ document.write('
') + + diff --git a/loleaflet/src/admin/AdminSocketSettings.js b/loleaflet/src/admin/AdminSocketSettings.js index 926df06..5f4ba6f 100644 --- a/loleaflet/src/admin/AdminSocketSettings.js +++ b/loleaflet/src/admin/AdminSocketSettings.js @@ -25,6 +25,16 @@ var AdminSocketSettings = AdminSocketBase.extend({ command += ' cpu_stats_interval=' + cpuStatsInterval; socketSettings.send(command); }); + + $('#btnShutdown').click(function() { + vex.dialog.confirm({ + message: _('Are you sure you want to shutdown the server?'), + callback: function(value) { + // TODO: Prompt for reason. + socketSettings.send('shutdown maintenance'); + } + }); + }); }); }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/Admin.cpp loolwsd/DocumentBroker.cpp loolwsd/IoUtil.cpp loolwsd/IoUtil.hpp loolwsd/LOOLKit.cpp loolwsd/LOOLWSD.cpp
loolwsd/Admin.cpp |2 +- loolwsd/DocumentBroker.cpp |5 +++-- loolwsd/IoUtil.cpp | 27 ++- loolwsd/IoUtil.hpp |1 + loolwsd/LOOLKit.cpp|4 ++-- loolwsd/LOOLWSD.cpp|2 +- 6 files changed, 22 insertions(+), 19 deletions(-) New commits: commit 853135decd123e1bbd521e7369378056caaabd56 Author: Ashod Nakashian Date: Sun Nov 13 22:23:04 2016 -0500 loolwsd: SocketProcessor can be named and name used in logs Change-Id: I599b6f7308690b49a0e9ed3c23b88dbcb2ed8848 Reviewed-on: https://gerrit.libreoffice.org/30830 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/Admin.cpp b/loolwsd/Admin.cpp index 9fc3535..560acbe 100644 --- a/loolwsd/Admin.cpp +++ b/loolwsd/Admin.cpp @@ -213,7 +213,7 @@ void AdminRequestHandler::handleWSRequests(HTTPServerRequest& request, HTTPServe model.subscribe(_sessionId, _adminWs); } -IoUtil::SocketProcessor(_adminWs, +IoUtil::SocketProcessor(_adminWs, "admin", [this](const std::vector& payload) { return adminCommandHandler(payload); diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp index 51badf4..a71d405 100644 --- a/loolwsd/DocumentBroker.cpp +++ b/loolwsd/DocumentBroker.cpp @@ -37,9 +37,10 @@ using Poco::StringTokenizer; void ChildProcess::socketProcessor() { -Util::setThreadName("child_ws_" + std::to_string(_pid)); +const auto name = "docbrk_ws_" + std::to_string(_pid); +Util::setThreadName(name); -IoUtil::SocketProcessor(_ws, +IoUtil::SocketProcessor(_ws, name, [this](const std::vector& payload) { const auto message = LOOLProtocol::getAbbreviatedMessage(payload); diff --git a/loolwsd/IoUtil.cpp b/loolwsd/IoUtil.cpp index ff88892..4368af1 100644 --- a/loolwsd/IoUtil.cpp +++ b/loolwsd/IoUtil.cpp @@ -41,11 +41,12 @@ namespace IoUtil // Synchronously process LOOLWebSocket requests and dispatch to handler. // Handler returns false to end. void SocketProcessor(const std::shared_ptr& ws, + const std::string& name, const std::function&)>& handler, const std::function& closeFrame, const std::function& stopPredicate) { -LOG_INF("SocketProcessor starting."); +LOG_INF("SocketProcessor [" << name << "] starting."); // Timeout given is in microseconds. static const Poco::Timespan waitTime(POLL_TIMEOUT_MS * 1000); @@ -65,7 +66,7 @@ void SocketProcessor(const std::shared_ptr& ws, stop = stopPredicate(); if (stop) { -LOG_INF("Termination flagged. Finishing."); +LOG_INF("SocketProcessor [" << name << "]: Stop flagged."); break; } @@ -85,13 +86,13 @@ void SocketProcessor(const std::shared_ptr& ws, } catch (const Poco::TimeoutException&) { -LOG_DBG("SocketProcessor: Spurious TimeoutException, ignored"); +LOG_DBG("SocketProcessor [" << name << "]: Spurious TimeoutException, ignored"); continue; } if (n <= 0 || ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE)) { -LOG_WRN("Connection closed."); +LOG_WRN("SocketProcessor [" << name << "]: Connection closed."); closeFrame(); break; } @@ -103,14 +104,14 @@ void SocketProcessor(const std::shared_ptr& ws, { // One WS message split into multiple frames. // TODO: Is this even possible with Poco if we never construct such messages outselves? -LOG_WRN("Receiving multi-parm frame."); +LOG_WRN("SocketProcessor [" << name << "]: Receiving multi-parm frame."); while (true) { char buffer[READ_BUFFER_SIZE * 10]; n = ws->receiveFrame(buffer, sizeof(buffer), flags); if (n <= 0 || (flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE) { -LOG_WRN("Connection closed while reading multiframe message."); +LOG_WRN("SocketProcessor [" << name << "]: Connection closed while reading multiframe message."); closeFrame(); break; } @@ -132,10 +133,10 @@ void SocketProcessor(const std::shared_ptr& ws, if (tokens.count() == 2 && tokens[0] == "nextmessage:" && LOOLProtocol::getTokenInteger(tokens[1], "size", size) && size > 0) { -LOG_TRC("Getting large message of " << size << " bytes."); +LOG_TRC("Soc
[Libreoffice-commits] online.git: loolwsd/Admin.cpp loolwsd/LOOLWSD.cpp loolwsd/Util.cpp loolwsd/Util.hpp
loolwsd/Admin.cpp |8 +++- loolwsd/LOOLWSD.cpp | 10 +- loolwsd/Util.cpp|1 + loolwsd/Util.hpp|3 +++ 4 files changed, 16 insertions(+), 6 deletions(-) New commits: commit d02f6778be1e23fa30946e806db08c8274da Author: Ashod Nakashian Date: Sun Nov 13 23:55:18 2016 -0500 loolwsd: support shutdown admin command Change-Id: Ib87ad2c289d59734c7a7a12e821de89e61c05079 Reviewed-on: https://gerrit.libreoffice.org/30831 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/Admin.cpp b/loolwsd/Admin.cpp index 560acbe..dc2aa9d 100644 --- a/loolwsd/Admin.cpp +++ b/loolwsd/Admin.cpp @@ -91,7 +91,7 @@ bool AdminRequestHandler::adminCommandHandler(const std::vector& payload) tokens[0] == "active_users_count" || tokens[0] == "active_docs_count" || tokens[0] == "mem_stats" || - tokens[0] == "cpu_stats" ) + tokens[0] == "cpu_stats") { const std::string result = model.query(tokens[0]); if (!result.empty()) @@ -144,6 +144,12 @@ bool AdminRequestHandler::adminCommandHandler(const std::vector& payload) std::string responseFrame = oss.str(); sendTextFrame(responseFrame); } +else if (tokens[0] == "shutdown") +{ +LOG_INF("Shutdown requested by admin."); +ShutdownFlag = true; +return false; +} else if (tokens[0] == "set" && tokens.count() > 1) { for (unsigned i = 1; i < tokens.count(); i++) diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 91329d6..4bd22bb 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -884,7 +884,7 @@ private: return session->handleInput(payload.data(), payload.size()); }, [&session]() { session->closeFrame(); }, -[]() { return !!TerminationFlag; }); +[]() { return TerminationFlag || ShutdownFlag; }); // Connection terminated. Destroy session. LOG_DBG("Client session [" << id << "] terminated. Cleaning up."); @@ -1966,7 +1966,7 @@ int LOOLWSD::main(const std::vector& /*args*/) time_t last30SecCheck = time(nullptr); int status = 0; -while (!TerminationFlag) +while (!TerminationFlag && !ShutdownFlag) { UnitWSD::get().invokeTest(); if (TerminationFlag) @@ -2073,11 +2073,11 @@ int LOOLWSD::main(const std::vector& /*args*/) #endif } -// stop the service, no more request +// Stop the listening to new connections +// and wait until sockets close. +LOG_INF("Stopping server socket listening."); srv.stop(); srv2.stop(); - -// close all websockets threadPool.joinAll(); // Terminate child processes diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp index deb2819..2bc780c 100644 --- a/loolwsd/Util.cpp +++ b/loolwsd/Util.cpp @@ -51,6 +51,7 @@ #include "Util.hpp" std::atomic TerminationFlag(false); +std::atomic ShutdownFlag(false); std::mutex SigHandlerTrap; namespace Util diff --git a/loolwsd/Util.hpp b/loolwsd/Util.hpp index 2303a65..792835c 100644 --- a/loolwsd/Util.hpp +++ b/loolwsd/Util.hpp @@ -30,6 +30,9 @@ /// Flag to stop pump loops. extern std::atomic TerminationFlag; +/// Flag to shutdown the server. +extern std::atomic ShutdownFlag; + /// Mutex to trap signal handler, if any, /// and prevent _Exit while collecting backtrace. extern std::mutex SigHandlerTrap; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loolwsd/Common.hpp loolwsd/IoUtil.cpp loolwsd/test
loolwsd/Common.hpp |4 ++ loolwsd/IoUtil.cpp | 68 ++--- loolwsd/test/countloolkits.hpp |5 ++- 3 files changed, 45 insertions(+), 32 deletions(-) New commits: commit 03a0347c1409bbc0e40003cbbd0f52abd2a351af Author: Ashod Nakashian Date: Sun Nov 13 21:59:14 2016 -0500 loolwsd: don't make noise on spurious errors while testing Change-Id: I6ab24367fddc8ab49843289af9bfc2241dc6005f Reviewed-on: https://gerrit.libreoffice.org/30829 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/test/countloolkits.hpp b/loolwsd/test/countloolkits.hpp index 947604b..4338a2f 100644 --- a/loolwsd/test/countloolkits.hpp +++ b/loolwsd/test/countloolkits.hpp @@ -58,7 +58,10 @@ static int getLoolKitProcessCount() } catch (const std::exception& ex) { -std::cerr << "Error while iterating processes: " << ex.what() << std::endl; +// 'File not found' is common here, since there is a race +// between iterating the /proc directory and opening files, +// the process in question might have been gone. +//std::cerr << "Error while iterating processes: " << ex.what() << std::endl; } } commit 18fd7b7f75e41ea28876c27aff1a7368c8a2e83d Author: Ashod Nakashian Date: Sun Nov 13 21:52:02 2016 -0500 loolwsd: SocketProcessor cleanup Change-Id: I120574dce169e1e8149aeba9d982b8235fa034fb Reviewed-on: https://gerrit.libreoffice.org/30828 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/Common.hpp b/loolwsd/Common.hpp index 686b556..814ab59 100644 --- a/loolwsd/Common.hpp +++ b/loolwsd/Common.hpp @@ -28,6 +28,10 @@ constexpr int WS_SEND_TIMEOUT_MS = 1000; /// which can be 1500 bytes long. constexpr int READ_BUFFER_SIZE = 2048; +/// Message larger than this will be dropped as invalid +/// or as intentionally flooding the server. +constexpr int MAX_MESSAGE_SIZE = 100 * 1024 * READ_BUFFER_SIZE; + constexpr auto JAILED_DOCUMENT_ROOT = "/user/docs/"; constexpr auto CHILD_URI = "/loolws/child?"; constexpr auto NEW_CHILD_URI = "/loolws/newchild?"; diff --git a/loolwsd/IoUtil.cpp b/loolwsd/IoUtil.cpp index 9b2a787..ff88892 100644 --- a/loolwsd/IoUtil.cpp +++ b/loolwsd/IoUtil.cpp @@ -49,14 +49,15 @@ void SocketProcessor(const std::shared_ptr& ws, // Timeout given is in microseconds. static const Poco::Timespan waitTime(POLL_TIMEOUT_MS * 1000); +const auto bufferSize = READ_BUFFER_SIZE * 100; +int flags = 0; +int n = -1; +bool stop = false; +std::vector payload(bufferSize); try { ws->setReceiveTimeout(0); -int flags = 0; -int n = 0; -bool stop = false; -std::vector payload(READ_BUFFER_SIZE * 100); payload.resize(0); for (;;) @@ -75,22 +76,23 @@ void SocketProcessor(const std::shared_ptr& ws, continue; } -payload.resize(payload.capacity()); try { +payload.resize(payload.capacity()); +n = -1; n = ws->receiveFrame(payload.data(), payload.capacity(), flags); +payload.resize(n > 0 ? n : 0); } catch (const Poco::TimeoutException&) { LOG_DBG("SocketProcessor: Spurious TimeoutException, ignored"); continue; } -payload.resize(n > 0 ? n : 0); if (n <= 0 || ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE)) { -closeFrame(); LOG_WRN("Connection closed."); +closeFrame(); break; } @@ -100,14 +102,16 @@ void SocketProcessor(const std::shared_ptr& ws, if ((flags & WebSocket::FrameFlags::FRAME_FLAG_FIN) != WebSocket::FrameFlags::FRAME_FLAG_FIN) { // One WS message split into multiple frames. +// TODO: Is this even possible with Poco if we never construct such messages outselves? +LOG_WRN("Receiving multi-parm frame."); while (true) { char buffer[READ_BUFFER_SIZE * 10]; n = ws->receiveFrame(buffer, sizeof(buffer), flags); if (n <= 0 || (flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE) { -closeFrame(); LOG_WRN("Connection closed while reading multiframe message."); +closeFrame(); break; } @@ -123,17 +127,21 @@ void SocketProcessor(const std::shared_ptr& ws, { int size = 0; Poco::StringTokenizer tokens(firstLine, " ", Poco::StringTokenizer::TOK_IGNORE
[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/LOOLWSD.cpp
loolwsd/DocumentBroker.cpp |1 - loolwsd/LOOLWSD.cpp| 15 +-- 2 files changed, 13 insertions(+), 3 deletions(-) New commits: commit 92ca5225a56bd511ac81bbb456f12f2670625a5b Author: Ashod Nakashian Date: Sun Nov 13 16:14:58 2016 -0500 loolwsd: logs and consistent formatting Change-Id: If32bb829b125678c6e8f83c39a3812098f3b38a3 Reviewed-on: https://gerrit.libreoffice.org/30827 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp index 5412c4b..51badf4 100644 --- a/loolwsd/DocumentBroker.cpp +++ b/loolwsd/DocumentBroker.cpp @@ -68,7 +68,6 @@ void ChildProcess::socketProcessor() LOG_DBG("Child [" << getPid() << "] WS terminated. Notifying DocBroker."); - // Notify the broker that we're done. auto docBroker = _docBroker.lock(); if (docBroker && !_stop) diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 4655a91..bb2bd85 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -1926,7 +1926,11 @@ int LOOLWSD::main(const std::vector& /*args*/) findFreeMasterPort(MasterPortNumber) : getMasterSocket(MasterPortNumber)); if (!psvs2) +{ +LOG_FTL("Failed to listen on master port (" << +MasterPortNumber << ") or find a free port. Exiting."); return Application::EXIT_SOFTWARE; +} HTTPServer srv2(new PrisonerRequestHandlerFactory(), threadPool, *psvs2, params2); LOG_INF("Starting prisoner server listening on " << MasterPortNumber); @@ -1946,7 +1950,11 @@ int LOOLWSD::main(const std::vector& /*args*/) findFreeServerPort(ClientPortNumber) : getServerSocket(ClientPortNumber, true)); if (!psvs) +{ +LOG_FTL("Failed to listen on client port (" << +ClientPortNumber << ") or find a free port. Exiting."); return Application::EXIT_SOFTWARE; +} HTTPServer srv(new ClientRequestHandlerFactory(), threadPool, *psvs, params1); LOG_INF("Starting master server listening on " << ClientPortNumber); @@ -1962,7 +1970,9 @@ int LOOLWSD::main(const std::vector& /*args*/) { UnitWSD::get().invokeTest(); if (TerminationFlag) +{ break; +} const pid_t pid = waitpid(forKitPid, &status, WUNTRACED | WNOHANG); if (pid > 0) @@ -2018,7 +2028,7 @@ int LOOLWSD::main(const std::vector& /*args*/) // No child processes. LOG_FTL("No Forkit instance. Terminating."); TerminationFlag = true; -continue; +break; } } else // pid == 0, no children have died @@ -2058,6 +2068,7 @@ int LOOLWSD::main(const std::vector& /*args*/) { LOG_INF((time(nullptr) - startTimeSpan) << " seconds gone, finishing as requested."); TerminationFlag = true; +break; } #endif } @@ -2070,7 +2081,7 @@ int LOOLWSD::main(const std::vector& /*args*/) threadPool.joinAll(); // Terminate child processes -LOG_INF("Requesting child process " << forKitPid << " to terminate."); +LOG_INF("Requesting forkit process " << forKitPid << " to terminate."); Util::requestTermination(forKitPid); for (auto& child : NewChildren) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/LOOLKit.cpp loolwsd/LOOLWSD.cpp loolwsd/Util.cpp loolwsd/Util.hpp
loolwsd/LOOLKit.cpp | 10 +- loolwsd/LOOLWSD.cpp |3 ++- loolwsd/Util.cpp| 13 - loolwsd/Util.hpp|5 + 4 files changed, 24 insertions(+), 7 deletions(-) New commits: commit 47d040f34532e1b913a64d340dd891601a83072b Author: Ashod Nakashian Date: Sun Nov 13 16:13:36 2016 -0500 loolwsd: handle SIGINT in WSD only CONTROL-C is now handled by WSD only to have full control over server shutting down. Also set signal handlers first thing to trap any early failures. Change-Id: Ifc5c93b9dd2aef288eed0ed36c600a639dbc6a44 Reviewed-on: https://gerrit.libreoffice.org/30826 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp index 507ad94..17bd15c 100644 --- a/loolwsd/LOOLKit.cpp +++ b/loolwsd/LOOLKit.cpp @@ -1279,6 +1279,11 @@ void lokit_main(const std::string& childRoot, bool queryVersion, bool displayVersion) { +Util::setFatalSignals(); +Util::setTerminationSignals(); + +Util::setThreadName("loolkit"); + // Reinitialize logging when forked. const bool logToFile = std::getenv("LOOL_LOGFILE"); const char* logFilename = std::getenv("LOOL_LOGFILENAME"); @@ -1304,13 +1309,8 @@ void lokit_main(const std::string& childRoot, static const std::string pid = std::to_string(Process::id()); static const std::string jailId = pid; -Util::setThreadName("loolkit"); - LOG_DBG("Process started."); -Util::setTerminationSignals(); -Util::setFatalSignals(); - std::string userdir_url; std::string instdir_path; diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 177b155..4655a91 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -1846,8 +1846,9 @@ Process::PID LOOLWSD::createForKit() int LOOLWSD::main(const std::vector& /*args*/) { -Util::setTerminationSignals(); Util::setFatalSignals(); +Util::setTerminationSignals(); +Util::setInterruptionSignal(); // down-pay all the forkit linking cost once & early. Environment::set("LD_BIND_NOW", "1"); diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp index b5c26a7..deb2819 100644 --- a/loolwsd/Util.cpp +++ b/loolwsd/Util.cpp @@ -218,11 +218,22 @@ namespace Util action.sa_handler = handleTerminationSignal; sigaction(SIGTERM, &action, nullptr); -sigaction(SIGINT, &action, nullptr); sigaction(SIGQUIT, &action, nullptr); sigaction(SIGHUP, &action, nullptr); } +/// Handle SIGINT, should be set by WSD only. +void setInterruptionSignal() +{ +struct sigaction action; + +sigemptyset(&action.sa_mask); +action.sa_flags = 0; +action.sa_handler = handleTerminationSignal; + +sigaction(SIGINT, &action, nullptr); +} + static char FatalGdbString[256] = { '\0' }; static diff --git a/loolwsd/Util.hpp b/loolwsd/Util.hpp index 93c95f7..2303a65 100644 --- a/loolwsd/Util.hpp +++ b/loolwsd/Util.hpp @@ -84,8 +84,13 @@ namespace Util /// Trap signals to cleanup and exit the process gracefully. void setTerminationSignals(); + +/// Trap all fatal signals to assist debugging. void setFatalSignals(); +/// Trap SIGINT, should be set by WSD only. +void setInterruptionSignal(); + void requestTermination(const Poco::Process::PID& pid); /// Kills a child process and returns true when ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/Admin.cpp loolwsd/DocumentBroker.hpp loolwsd/LOOLForKit.cpp loolwsd/Util.cpp loolwsd/Util.hpp
loolwsd/Admin.cpp | 11 --- loolwsd/DocumentBroker.hpp | 17 - loolwsd/LOOLForKit.cpp |2 +- loolwsd/Util.cpp | 29 + loolwsd/Util.hpp |5 + 5 files changed, 47 insertions(+), 17 deletions(-) New commits: commit 6ad3b64d30a1398a9d355a7b9b9ab7ece1658c3f Author: Ashod Nakashian Date: Sun Nov 13 16:12:01 2016 -0500 loolwsd: kill children using SIGTERM from via a helper function Change-Id: I901183fc59725681208a5c0f23f0916e158e5654 Reviewed-on: https://gerrit.libreoffice.org/30825 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/Admin.cpp b/loolwsd/Admin.cpp index e8d9d3a..9fc3535 100644 --- a/loolwsd/Admin.cpp +++ b/loolwsd/Admin.cpp @@ -123,15 +123,12 @@ bool AdminRequestHandler::adminCommandHandler(const std::vector& payload) try { const auto pid = std::stoi(tokens[1]); -if (kill(pid, SIGINT) != 0 && kill(pid, 0) !=0) -{ -LOG_SYS("Cannot terminate PID: " << tokens[0]); -} +LOG_INF("Admin request to kill PID: " << pid); +Util::killChild(pid); } -catch(std::invalid_argument& exc) +catch (std::invalid_argument& exc) { -Log::warn() << "Invalid PID to kill: " << tokens[0] << Log::end; -return false; +LOG_WRN("Invalid PID to kill: " << tokens[1]); } } else if (tokens[0] == "settings") diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp index 6906391..2184925 100644 --- a/loolwsd/DocumentBroker.hpp +++ b/loolwsd/DocumentBroker.hpp @@ -96,24 +96,21 @@ public: } _ws.reset(); -if (_pid != -1 && kill(_pid, 0) != 0) +if (_pid != -1 && rude && kill(_pid, 0) != 0 && errno != ESRCH) { -if (errno != ESRCH && rude) +LOG_INF("Killing child [" << _pid << "]."); +if (Util::killChild(_pid)) { -LOG_INF("Killing child [" << _pid << "]."); -if (kill(_pid, SIGINT) != 0 && kill(_pid, 0) != 0 && errno != ESRCH) -{ -LOG_SYS("Cannot terminate lokit [" << _pid << "]. Abandoning."); -} +LOG_ERR("Cannot terminate lokit [" << _pid << "]. Abandoning."); } } - -_pid = -1; } catch (const std::exception& ex) { LOG_ERR("Error while closing child process: " << ex.what()); } + +_pid = -1; } Poco::Process::PID getPid() const { return _pid; } @@ -142,6 +139,8 @@ public: } /// Check whether this child is alive and able to respond. +/// Note: zombies will show as alive, and sockets have waiting +/// time after the other end-point closes. So this isn't accurate. bool isAlive() const { try diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp index f234405..75156a0 100644 --- a/loolwsd/LOOLForKit.cpp +++ b/loolwsd/LOOLForKit.cpp @@ -77,7 +77,7 @@ public: } else if (ready < 0) { -// Termination is done via SIGINT, which breaks the wait. +// Termination is done via SIGTERM, which breaks the wait. if (!TerminationFlag) { Log::error("Error reading from pipe [" + getName() + "]."); diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp index e3a2b02..b5c26a7 100644 --- a/loolwsd/Util.cpp +++ b/loolwsd/Util.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -397,6 +398,34 @@ namespace Util static std::atomic_int counter(0); return std::to_string(Poco::Process::id()) + "/" + std::to_string(counter++); } + +bool killChild(const int pid) +{ +LOG_DBG("Killing PID: " << pid); +if (kill(pid, SIGTERM) == 0 || errno == ESRCH) +{ +// Killed or doesn't exist. +return true; +} + +LOG_SYS("Error when trying to kill PID: " << pid << ". Will wait for termination."); + +const auto sleepMs = 50; +const auto count = std::max(CHILD_REBALANCE_INTERVAL_MS / sleepMs, 2); +for (int i = 0; i < count; ++i) +{ +if (kill(pid, 0) == 0 || errno == ESRCH) +{ +// Doesn't exist. +return true; +} + +std::this_thread::sleep_for(std::chrono::milliseconds(sleepMs)); +} + +LOG_WRN("Cannot terminate PID: " << pid); +return false; +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/loolwsd/Util.hpp b/loolwsd/Util.hpp index 7e4170f..93c95f7 100644 --- a/loolwsd/Util.hpp +++ b/loolwsd/Util.hpp @@ -88,6 +88,11 @@ namespace Util void
[Libreoffice-commits] online.git: loolwsd/ClientSession.cpp loolwsd/ClientSession.hpp loolwsd/LOOLWSD.cpp loolwsd/PrisonerSession.cpp loolwsd/PrisonerSession.hpp
loolwsd/ClientSession.cpp | 11 --- loolwsd/ClientSession.hpp |2 -- loolwsd/LOOLWSD.cpp | 12 +++- loolwsd/PrisonerSession.cpp | 11 --- loolwsd/PrisonerSession.hpp |2 -- 5 files changed, 3 insertions(+), 35 deletions(-) New commits: commit 7b87e4ab7831894a67c106771fc389f259784422 Author: Ashod Nakashian Date: Sun Nov 13 12:33:16 2016 -0500 loolwsd: kill superfluous shutdownPeer Change-Id: I50880e15b5e36f7701bafbfa59be57ed6bd856c1 Reviewed-on: https://gerrit.libreoffice.org/30824 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/ClientSession.cpp b/loolwsd/ClientSession.cpp index 2ab3e7a..93d68df 100644 --- a/loolwsd/ClientSession.cpp +++ b/loolwsd/ClientSession.cpp @@ -383,17 +383,6 @@ bool ClientSession::sendCombinedTiles(const char* /*buffer*/, int /*length*/, St return true; } -bool ClientSession::shutdownPeer(Poco::UInt16 statusCode) -{ -if (_peer && !_peer->isCloseFrame()) -{ -_peer->shutdown(statusCode); -return true; -} - -return false; -} - bool ClientSession::forwardToChild(const std::string& message, const std::shared_ptr& docBroker) { diff --git a/loolwsd/ClientSession.hpp b/loolwsd/ClientSession.hpp index ae41b63..7b7740c 100644 --- a/loolwsd/ClientSession.hpp +++ b/loolwsd/ClientSession.hpp @@ -36,10 +36,8 @@ public: /// Create and connect Prisoner Session between DocumentBroker and us. void bridgePrisonerSession(); std::shared_ptr getPeer() const { return _peer; } -bool shutdownPeer(Poco::UInt16 statusCode); const std::string getUserId() const { return _userId; } - void setUserId(const std::string& userId) { _userId = userId; } void setUserName(const std::string& userName) { _userName = userName; } void setDocumentOwner(const bool isDocumentOwner) { _isDocumentOwner = isDocumentOwner; } diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 507c1a4..177b155 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -579,8 +579,6 @@ private: { LOG_ERR("Multiple sessions during conversion. " << sessionsCount << " sessions remain."); } - -session->shutdownPeer(WebSocket::WS_NORMAL_CLOSE); } // Clean up the temporary directory the HTMLForm ctor created. @@ -970,12 +968,9 @@ private: if (session->isCloseFrame()) { LOG_TRC("Normal close handshake."); -if (session->shutdownPeer(WebSocket::WS_NORMAL_CLOSE)) -{ -// Client initiated close handshake -// respond close frame -ws->shutdown(); -} +// Client initiated close handshake +// respond close frame +ws->shutdown(); } else { @@ -984,7 +979,6 @@ private: session->closeFrame(); // FIXME: handle exception thrown from here ? ... ws->shutdown(WebSocket::WS_ENDPOINT_GOING_AWAY); -session->shutdownPeer(WebSocket::WS_ENDPOINT_GOING_AWAY); } LOG_INF("Finished GET request handler for session [" << id << "]."); diff --git a/loolwsd/PrisonerSession.cpp b/loolwsd/PrisonerSession.cpp index 8696992..a7cfa3a 100644 --- a/loolwsd/PrisonerSession.cpp +++ b/loolwsd/PrisonerSession.cpp @@ -258,15 +258,4 @@ bool PrisonerSession::_handleInput(const char *buffer, int length) return true; } -bool PrisonerSession::shutdownPeer(Poco::UInt16 statusCode) -{ -auto peer = _peer.lock(); -if (peer && !peer->isCloseFrame()) -{ -peer->shutdown(statusCode); -} - -return peer != nullptr; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/loolwsd/PrisonerSession.hpp b/loolwsd/PrisonerSession.hpp index 55a3de5..a52dfc8 100644 --- a/loolwsd/PrisonerSession.hpp +++ b/loolwsd/PrisonerSession.hpp @@ -26,8 +26,6 @@ public: virtual ~PrisonerSession(); -bool shutdownPeer(Poco::UInt16 statusCode); - private: /// Handle messages from the Kit to the client. virtual bool _handleInput(const char* buffer, int length) override; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/ClientSession.cpp loolwsd/ClientSession.hpp loolwsd/DocumentBroker.cpp loolwsd/PrisonerSession.cpp loolwsd/PrisonerSession.hpp
loolwsd/ClientSession.cpp | 15 +++ loolwsd/ClientSession.hpp |3 ++- loolwsd/DocumentBroker.cpp |7 ++- loolwsd/PrisonerSession.cpp |5 +++-- loolwsd/PrisonerSession.hpp |8 +--- 5 files changed, 27 insertions(+), 11 deletions(-) New commits: commit 71c5f6c303bd6cf72588526fe93937ff3c313911 Author: Ashod Nakashian Date: Sun Nov 13 12:26:00 2016 -0500 loolwsd: simplify PrisonerSession Change-Id: If626b9e5ceb206480f29d4b4b70eeffca55a83c2 Reviewed-on: https://gerrit.libreoffice.org/30823 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/ClientSession.cpp b/loolwsd/ClientSession.cpp index 24b53c5..2ab3e7a 100644 --- a/loolwsd/ClientSession.cpp +++ b/loolwsd/ClientSession.cpp @@ -57,6 +57,21 @@ ClientSession::~ClientSession() _saveAsQueue.put(""); } +void ClientSession::bridgePrisonerSession() +{ +auto docBroker = getDocumentBroker(); +if (docBroker) +{ +_peer = std::make_shared(shared_from_this(), docBroker); +} +else +{ +const std::string msg = "No valid DocBroker while bridging Prisoner Session for " + getName(); +LOG_ERR(msg); +throw std::runtime_error(msg); +} +} + bool ClientSession::_handleInput(const char *buffer, int length) { const std::string firstLine = getFirstLine(buffer, length); diff --git a/loolwsd/ClientSession.hpp b/loolwsd/ClientSession.hpp index 4340f46..ae41b63 100644 --- a/loolwsd/ClientSession.hpp +++ b/loolwsd/ClientSession.hpp @@ -33,7 +33,8 @@ public: void setReadOnly(); bool isReadOnly() const { return _isReadOnly; } -void setPeer(const std::shared_ptr& peer) { _peer = peer; } +/// Create and connect Prisoner Session between DocumentBroker and us. +void bridgePrisonerSession(); std::shared_ptr getPeer() const { return _peer; } bool shutdownPeer(Poco::UInt16 statusCode); diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp index 4a79836..5412c4b 100644 --- a/loolwsd/DocumentBroker.cpp +++ b/loolwsd/DocumentBroker.cpp @@ -531,11 +531,8 @@ size_t DocumentBroker::addSession(std::shared_ptr& session) // Tell the admin console about this new doc Admin::instance().addDoc(_docKey, getPid(), getFilename(), id); -auto prisonerSession = std::make_shared(id, shared_from_this()); - -// Connect the prison session to the client. -session->setPeer(prisonerSession); -prisonerSession->setPeer(session); +// Now we are ready to bridge between the kit and client. +session->bridgePrisonerSession(); return count; } diff --git a/loolwsd/PrisonerSession.cpp b/loolwsd/PrisonerSession.cpp index 76e074c..8696992 100644 --- a/loolwsd/PrisonerSession.cpp +++ b/loolwsd/PrisonerSession.cpp @@ -33,10 +33,11 @@ using namespace LOOLProtocol; using Poco::Path; using Poco::StringTokenizer; -PrisonerSession::PrisonerSession(const std::string& id, +PrisonerSession::PrisonerSession(std::shared_ptr clientSession, std::shared_ptr docBroker) : -LOOLSession(id, Kind::ToPrisoner, nullptr), +LOOLSession(clientSession->getId(), Kind::ToPrisoner, nullptr), _docBroker(std::move(docBroker)), +_peer(clientSession), _curPart(0) { LOG_INF("PrisonerSession ctor [" << getName() << "]."); diff --git a/loolwsd/PrisonerSession.hpp b/loolwsd/PrisonerSession.hpp index 87cba16..55a3de5 100644 --- a/loolwsd/PrisonerSession.hpp +++ b/loolwsd/PrisonerSession.hpp @@ -15,19 +15,21 @@ class DocumentBroker; class ClientSession; -/// Represents a session to a Kit process, in the WSD process. +/// Represents an internal session to a Kit process, in the WSD process. +/// This doesn't really have a direct connection to any Kit process, rather +/// all communication to said Kit process is really handled by DocumentBroker. class PrisonerSession final : public LOOLSession, public std::enable_shared_from_this { public: -PrisonerSession(const std::string& id, +PrisonerSession(std::shared_ptr clientSession, std::shared_ptr docBroker); virtual ~PrisonerSession(); -void setPeer(const std::shared_ptr& peer) { _peer = peer; } bool shutdownPeer(Poco::UInt16 statusCode); private: +/// Handle messages from the Kit to the client. virtual bool _handleInput(const char* buffer, int length) override; private: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/Admin.cpp loolwsd/DocumentBroker.hpp loolwsd/IoUtil.cpp loolwsd/Log.hpp loolwsd/LOOLForKit.cpp loolwsd/LOOLKit.cpp loolwsd/LOOLWSD.cpp loolwsd/Util.cpp
loolwsd/Admin.cpp |2 +- loolwsd/DocumentBroker.hpp |2 +- loolwsd/IoUtil.cpp |2 +- loolwsd/LOOLForKit.cpp |8 loolwsd/LOOLKit.cpp| 24 loolwsd/LOOLWSD.cpp|8 loolwsd/Log.hpp|2 ++ loolwsd/Util.cpp |6 -- 8 files changed, 29 insertions(+), 25 deletions(-) New commits: commit b7df3b50a92a55fc5a44c824c0f81353201b26ac Author: Ashod Nakashian Date: Sun Nov 13 11:59:34 2016 -0500 loolwsd: Log::syserror and Log::sysfatal now supported as macro Change-Id: Ic07e7fb46e0b3e01db164e5812ef9256f149e5d9 Reviewed-on: https://gerrit.libreoffice.org/30822 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/Admin.cpp b/loolwsd/Admin.cpp index 12b4c50..e8d9d3a 100644 --- a/loolwsd/Admin.cpp +++ b/loolwsd/Admin.cpp @@ -125,7 +125,7 @@ bool AdminRequestHandler::adminCommandHandler(const std::vector& payload) const auto pid = std::stoi(tokens[1]); if (kill(pid, SIGINT) != 0 && kill(pid, 0) !=0) { -Log::syserror("Cannot terminate PID: " + tokens[0]); +LOG_SYS("Cannot terminate PID: " << tokens[0]); } } catch(std::invalid_argument& exc) diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp index fc035f7..6906391 100644 --- a/loolwsd/DocumentBroker.hpp +++ b/loolwsd/DocumentBroker.hpp @@ -103,7 +103,7 @@ public: LOG_INF("Killing child [" << _pid << "]."); if (kill(_pid, SIGINT) != 0 && kill(_pid, 0) != 0 && errno != ESRCH) { -Log::syserror("Cannot terminate lokit [" + std::to_string(_pid) + "]. Abandoning."); +LOG_SYS("Cannot terminate lokit [" << _pid << "]. Abandoning."); } } } diff --git a/loolwsd/IoUtil.cpp b/loolwsd/IoUtil.cpp index 918cc54..9b2a787 100644 --- a/loolwsd/IoUtil.cpp +++ b/loolwsd/IoUtil.cpp @@ -206,7 +206,7 @@ ssize_t writeToPipe(int pipe, const char* buffer, ssize_t size) if (errno == EINTR || errno == EAGAIN) continue; -Log::syserror("Failed to write to pipe. Data: [" + std::string(buffer, size) + "]."); +LOG_SYS("Failed to write to pipe. Data: [" << std::string(buffer, size) << "]."); count = -1; break; } diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp index 9529139..f234405 100644 --- a/loolwsd/LOOLForKit.cpp +++ b/loolwsd/LOOLForKit.cpp @@ -113,7 +113,7 @@ static bool haveCapability(cap_value_t capability) if (caps == nullptr) { -Log::sysfatal("cap_get_proc() failed."); +LOG_SFL("cap_get_proc() failed."); return false; } @@ -124,12 +124,12 @@ static bool haveCapability(cap_value_t capability) { if (cap_name) { -Log::sysfatal("cap_get_flag failed for " + std::string(cap_name) + "."); +LOG_SFL("cap_get_flag failed for " << cap_name << "."); cap_free(cap_name); } else { -Log::sysfatal("cap_get_flag failed for capability " + std::to_string(capability) + "."); +LOG_SFL("cap_get_flag failed for capability " << capability << "."); } return false; } @@ -233,7 +233,7 @@ static int createLibreOfficeKit(const std::string& childRoot, // Parent if (pid < 0) { -Log::syserror("Fork failed."); +LOG_SYS("Fork failed."); } else { diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp index 397dcc5..507ad94 100644 --- a/loolwsd/LOOLKit.cpp +++ b/loolwsd/LOOLKit.cpp @@ -146,8 +146,8 @@ namespace File(newPath.parent()).createDirectories(); if (link(fpath, newPath.toString().c_str()) == -1) { -Log::syserror("link(\"" + std::string(fpath) + "\",\"" + newPath.toString() + - "\") failed. Exiting."); +LOG_SYS("link(\"" << std::string(fpath) << "\",\"" << +newPath.toString() << "\") failed. Exiting."); std::_Exit(Application::EXIT_SOFTWARE); } break; @@ -156,7 +156,7 @@ namespace struct stat st; if (stat(fpath, &st) == -1) { -Log::syserror("stat(\"" + std::string(fpath) + "\") failed."); +LOG_SYS("stat(\"" << std::string(fpath) << "\") failed."); return 1; } if (!shouldCopyDir(relativeOldPath)) @@ -170,7 +170,7 @@ namespace ut.modtime = st.st_mtime; if (utime(newPath.toString().c_str(), &ut) == -1) { -Log::syserror("utime(\"" +
[Libreoffice-commits] online.git: loolwsd/LOOLStress.cpp
loolwsd/LOOLStress.cpp |6 -- 1 file changed, 6 deletions(-) New commits: commit 41e0902cdf0fd2ae54616dc1d451aa7ebba78dbb Author: Ashod Nakashian Date: Sat Nov 12 16:43:17 2016 -0500 loolwsd: cleanup LOOLStress Change-Id: I8161488d30f8e173db47ccae5544b6d8b9f21f02 Reviewed-on: https://gerrit.libreoffice.org/30821 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/LOOLStress.cpp b/loolwsd/LOOLStress.cpp index 7dbe7a6..e8e86fc 100644 --- a/loolwsd/LOOLStress.cpp +++ b/loolwsd/LOOLStress.cpp @@ -39,10 +39,7 @@ #include #include -#include "Common.hpp" -#include "LOOLProtocol.hpp" #include "TraceFile.hpp" -#include "Util.hpp" #include "test/helpers.hpp" /// Stress testing and performance/scalability benchmarking tool. @@ -64,9 +61,6 @@ protected: int main(const std::vector& args) override; }; - -using namespace LOOLProtocol; - using Poco::Net::HTTPRequest; using Poco::Net::HTTPResponse; using Poco::Runnable; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/ChildSession.cpp loolwsd/common loolwsd/LOOLForKit.cpp loolwsd/LOOLWSD.cpp loolwsd/Makefile.am loolwsd/Storage.cpp loolwsd/test loolwsd/TileCache.cpp loolwsd/
loolwsd/ChildSession.cpp |3 loolwsd/LOOLForKit.cpp |3 loolwsd/LOOLWSD.cpp | 15 +- loolwsd/Makefile.am |2 loolwsd/Storage.cpp |3 loolwsd/TileCache.cpp| 11 + loolwsd/Util.cpp | 167 - loolwsd/Util.hpp | 59 - loolwsd/common/FileUtil.cpp | 202 +++ loolwsd/common/FileUtil.hpp | 93 ++ loolwsd/test/Makefile.am |1 loolwsd/test/helpers.hpp |3 loolwsd/test/integration-http-server.cpp |5 13 files changed, 328 insertions(+), 239 deletions(-) New commits: commit ad70138fc9c2df3b82b881f1f99b52b015cfb7f0 Author: Ashod Nakashian Date: Sat Nov 12 16:38:13 2016 -0500 loolwsd: move file utilities into FileUtil files Change-Id: Ib0c0bc66adabe6885f7ac16414a3d5af13d72893 Reviewed-on: https://gerrit.libreoffice.org/30820 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/ChildSession.cpp b/loolwsd/ChildSession.cpp index d27c91e..4a177ac 100644 --- a/loolwsd/ChildSession.cpp +++ b/loolwsd/ChildSession.cpp @@ -18,6 +18,7 @@ #include #include +#include "common/FileUtil.hpp" #include "LOKitHelper.hpp" #include "Log.hpp" #include "Png.hpp" @@ -574,7 +575,7 @@ bool ChildSession::downloadAs(const char* /*buffer*/, int /*length*/, StringToke } // The file is removed upon downloading. -const auto tmpDir = Util::createRandomDir(JAILED_DOCUMENT_ROOT); +const auto tmpDir = FileUtil::createRandomDir(JAILED_DOCUMENT_ROOT); // Prevent user inputting anything funny here. // A "name" should always be a name, not a path const Poco::Path filenameParam(name); diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp index 0bd55e8..9529139 100644 --- a/loolwsd/LOOLForKit.cpp +++ b/loolwsd/LOOLForKit.cpp @@ -32,6 +32,7 @@ #include #include "Common.hpp" +#include "common/FileUtil.hpp" #include "IoUtil.hpp" #include "LOOLKit.hpp" #include "Log.hpp" @@ -185,7 +186,7 @@ static void cleanupChildren() if (childJails.find(exitedChildPid) != childJails.end()) { Log::info("Child " + std::to_string(exitedChildPid) + " has exited, removing its jail '" + childJails[exitedChildPid] + "'"); -Util::removeFile(childJails[exitedChildPid], true); +FileUtil::removeFile(childJails[exitedChildPid], true); childJails.erase(exitedChildPid); } else diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 799a79c..1563d6b 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -99,6 +99,7 @@ #include "Common.hpp" #include "Exceptions.hpp" #include "FileServer.hpp" +#include "common/FileUtil.hpp" #include "IoUtil.hpp" #include "LOOLProtocol.hpp" #include "LOOLSession.hpp" @@ -257,7 +258,7 @@ static void forkChildren(const int number) if (number > 0) { -Util::checkDiskSpaceOnRegisteredFileSystems(); +FileUtil::checkDiskSpaceOnRegisteredFileSystems(); const std::string aMessage = "spawn " + std::to_string(number) + "\n"; LOG_DBG("MasterToForKit: " << aMessage.substr(0, aMessage.length() - 1)); @@ -585,7 +586,7 @@ private: // Clean up the temporary directory the HTMLForm ctor created. Path tempDirectory(fromPath); tempDirectory.setFileName(""); -Util::removeFile(tempDirectory, /*recursive=*/true); +FileUtil::removeFile(tempDirectory, /*recursive=*/true); } if (!sent) @@ -690,7 +691,7 @@ private: (exc.nested() ? " (" + exc.nested()->displayText() + ")" : "")); } -Util::removeFile(File(filePath.parent()).path(), true); +FileUtil::removeFile(File(filePath.parent()).path(), true); } else { @@ -870,7 +871,7 @@ private: LOG_TRC("Sending to Client [" << status << "]."); ws->sendFrame(status.data(), status.size()); -Util::checkDiskSpaceOnRegisteredFileSystems(); +FileUtil::checkDiskSpaceOnRegisteredFileSystems(); // Request the child to connect to us and add this session. auto sessionsCount = docBroker->addSession(session); @@ -1899,8 +1900,8 @@ int LOOLWSD::main(const std::vector& /*args*/) else if (ChildRoot[ChildRoot.size() - 1] != '/') ChildRoot += '/'; -Util::registerFileSystemForDiskSpaceChecks(ChildRoot); -Util::registerFileSystemForDiskSpaceChecks(Cache + "/."); +FileUtil::registerFileSystemForDiskSpaceChecks(ChildRoot); +FileUtil::registerFileSystemForDiskSpaceChecks(Cache + "/."); if (FileServerRoot.empty()) FileSer
[Libreoffice-commits] online.git: loolwsd/LOOLWebSocket.hpp
loolwsd/LOOLWebSocket.hpp | 44 1 file changed, 24 insertions(+), 20 deletions(-) New commits: commit 2906442f035252b436b5bd09c7e8d5bd4501bdb7 Author: Ashod Nakashian Date: Sat Nov 12 13:41:54 2016 -0500 loolwsd: cleanup LOOLWebSocket Change-Id: Iad16918a5e0bc239ba969bbe596c1d2c4c01cebb Reviewed-on: https://gerrit.libreoffice.org/30819 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/LOOLWebSocket.hpp b/loolwsd/LOOLWebSocket.hpp index 672b93a..b4956ce 100644 --- a/loolwsd/LOOLWebSocket.hpp +++ b/loolwsd/LOOLWebSocket.hpp @@ -19,38 +19,46 @@ #include /// WebSocket that is thread safe, and handles large frames transparently. +/// Careful - sendFrame and receiveFrame are _not_ virtual, +/// we need to make sure that we use LOOLWebSocket all over the place. +/// It would be a kind of more natural to encapsulate Poco::Net::WebSocket +/// instead of inheriting (from that reason,) but that would requite much +/// larger code changes. class LOOLWebSocket : public Poco::Net::WebSocket { +private: std::mutex _mutex; public: -LOOLWebSocket(const Socket & socket) : -Poco::Net::WebSocket(socket), -_mutex() +LOOLWebSocket(const Socket& socket) : +Poco::Net::WebSocket(socket) { } -LOOLWebSocket(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response) : -Poco::Net::WebSocket(request, response), -_mutex() +LOOLWebSocket(Poco::Net::HTTPServerRequest& request, + Poco::Net::HTTPServerResponse& response) : +Poco::Net::WebSocket(request, response) { } -LOOLWebSocket(Poco::Net::HTTPClientSession & cs, Poco::Net::HTTPRequest & request, Poco::Net::HTTPResponse & response) : -Poco::Net::WebSocket(cs, request, response), -_mutex() +LOOLWebSocket(Poco::Net::HTTPClientSession& cs, + Poco::Net::HTTPRequest& request, + Poco::Net::HTTPResponse& response) : +Poco::Net::WebSocket(cs, request, response) { } -LOOLWebSocket(Poco::Net::HTTPClientSession & cs, Poco::Net::HTTPRequest & request, Poco::Net::HTTPResponse & response, Poco::Net::HTTPCredentials & credentials) : -Poco::Net::WebSocket(cs, request, response, credentials), -_mutex() +LOOLWebSocket(Poco::Net::HTTPClientSession& cs, + Poco::Net::HTTPRequest& request, + Poco::Net::HTTPResponse& response, + Poco::Net::HTTPCredentials& credentials) : +Poco::Net::WebSocket(cs, request, response, credentials) { } -// Wrapper for LOOLWebSocket::receiveFrame() that handles PING frames (by replying with a -// PONG frame) and PONG frames. PONG frames are ignored. -// Should we also factor out the handling of non-final and continuation frames into this? +/// Wrapper for Poco::Net::WebSocket::receiveFrame() that handles PING frames +/// (by replying with a PONG frame) and PONG frames. PONG frames are ignored. +/// Should we also factor out the handling of non-final and continuation frames into this? int receiveFrame(char* buffer, const int length, int& flags) { // Timeout given is in microseconds. @@ -76,11 +84,7 @@ public: return -1; } -/// Careful - sendFrame is _not_ virtual, we need to make sure that we use -/// LOOLWebSocket all over the place -/// It would be a kind of more natural to encapsulate Poco::Net::WebSocket -/// instead of inheriting (from that reason), but that would requite much -/// larger code changes. +/// Wrapper for Poco::Net::WebSocket::sendFrame() that handles large frames. int sendFrame(const char* buffer, const int length, const int flags = FRAME_TEXT) { std::unique_lock lock(_mutex); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/LOOLWebSocket.hpp
loolwsd/LOOLWebSocket.hpp | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) New commits: commit 3cff7993019d10e7c11a3d9dd67ba760dcc061b8 Author: Ashod Nakashian Date: Sat Nov 12 13:41:16 2016 -0500 loolwsd: Log error when not sending full frame ... and timeout when receiving frame. Change-Id: I5bb085f494fc146f7fbd75be3f3bb86597029369 Reviewed-on: https://gerrit.libreoffice.org/30818 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/LOOLWebSocket.hpp b/loolwsd/LOOLWebSocket.hpp index 212990a..672b93a 100644 --- a/loolwsd/LOOLWebSocket.hpp +++ b/loolwsd/LOOLWebSocket.hpp @@ -51,9 +51,12 @@ public: // Wrapper for LOOLWebSocket::receiveFrame() that handles PING frames (by replying with a // PONG frame) and PONG frames. PONG frames are ignored. // Should we also factor out the handling of non-final and continuation frames into this? -int receiveFrame(char* buffer, int length, int& flags) +int receiveFrame(char* buffer, const int length, int& flags) { -for (;;) +// Timeout given is in microseconds. +static const Poco::Timespan waitTime(POLL_TIMEOUT_MS * 1000); + +while (poll(waitTime, Poco::Net::Socket::SELECT_READ)) { const int n = Poco::Net::WebSocket::receiveFrame(buffer, length, flags); if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING) @@ -78,9 +81,9 @@ public: /// It would be a kind of more natural to encapsulate Poco::Net::WebSocket /// instead of inheriting (from that reason), but that would requite much /// larger code changes. -int sendFrame(const void * buffer, int length, int flags = FRAME_TEXT) +int sendFrame(const char* buffer, const int length, const int flags = FRAME_TEXT) { -std::lock_guard lock(_mutex); +std::unique_lock lock(_mutex); // Size after which messages will be sent preceded with // 'nextmessage' frame to let the receiver know in advance @@ -95,8 +98,19 @@ public: Log::debug("Message is long, sent " + nextmessage); } -int result = Poco::Net::WebSocket::sendFrame(buffer, length, flags); -Log::debug("Sent frame: " + LOOLProtocol::getAbbreviatedMessage(static_cast(buffer), length)); +const int result = Poco::Net::WebSocket::sendFrame(buffer, length, flags); + +lock.unlock(); + +if (result != length) +{ +LOG_ERR("Sent incomplete message, expected " << length << " bytes but sent " << result << +" while sending: " << LOOLProtocol::getAbbreviatedMessage(buffer, length)); +} +else +{ +LOG_DBG("Sent frame: " << LOOLProtocol::getAbbreviatedMessage(buffer, length)); +} return result; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/test
loolwsd/test/helpers.hpp | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) New commits: commit b6926c2f4c9e7eb33cfbb5224e4675c4b1e67347 Author: Ashod Nakashian Date: Sat Nov 12 13:25:35 2016 -0500 loolwsd: proper retrying in connectLOKit Change-Id: Ib99a6012510457876f422767cf42b92f412df1f5 Reviewed-on: https://gerrit.libreoffice.org/30817 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/test/helpers.hpp b/loolwsd/test/helpers.hpp index 4f12c2e..6b291d8 100644 --- a/loolwsd/test/helpers.hpp +++ b/loolwsd/test/helpers.hpp @@ -343,20 +343,24 @@ connectLOKit(const Poco::URI& uri, Poco::Net::HTTPResponse& response, const std::string& name = "") { +std::cerr << name << "Connecting... "; int retries = 10; do { std::unique_ptr session(createSession(uri)); - -std::cerr << name << "Connecting... " << std::endl; auto ws = std::make_shared(*session, request, response); -getResponseMessage(ws, "statusindicator: ready", name); +const auto expected_response = "statusindicator: ready"; +if (getResponseString(ws, expected_response, name) == expected_response) +{ +return ws; +} -return ws; +std::cerr << (11 - retries); } while (retries--); -CPPUNIT_FAIL("Cannot connect to [" + uri.toString() + "]."); +std::cerr << std::endl; +throw std::runtime_error("Cannot connect to [" + uri.toString() + "]."); } inline ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/IoUtil.cpp loolwsd/IoUtil.hpp loolwsd/LOOLWebSocket.hpp loolwsd/Makefile.am
loolwsd/IoUtil.cpp| 24 +--- loolwsd/IoUtil.hpp|5 - loolwsd/LOOLWebSocket.hpp | 25 + loolwsd/Makefile.am |2 +- 4 files changed, 27 insertions(+), 29 deletions(-) New commits: commit 0506cbb5c4bc3eaa708b92ea88ee1a02f1e4502e Author: Ashod Nakashian Date: Sat Nov 12 13:12:26 2016 -0500 loolwsd: move reveiveFrame from IoUtil to LOOLWebSocket Change-Id: I82b64d16e496f104c34eeddce1ef9a1e57bc03bc Reviewed-on: https://gerrit.libreoffice.org/30816 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/IoUtil.cpp b/loolwsd/IoUtil.cpp index 75b7026..918cc54 100644 --- a/loolwsd/IoUtil.cpp +++ b/loolwsd/IoUtil.cpp @@ -38,28 +38,6 @@ using Poco::Net::WebSocket; namespace IoUtil { -int receiveFrame(LOOLWebSocket& socket, void* buffer, int length, int& flags) -{ -while (!TerminationFlag) -{ -int n = socket.receiveFrame(buffer, length, flags); -if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING) -{ -socket.sendFrame(buffer, n, WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PONG); -} -else if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PONG) -{ -// In case we do send pongs in the future. -} -else -{ -return n; -} -} - -return -1; -} - // Synchronously process LOOLWebSocket requests and dispatch to handler. // Handler returns false to end. void SocketProcessor(const std::shared_ptr& ws, @@ -100,7 +78,7 @@ void SocketProcessor(const std::shared_ptr& ws, payload.resize(payload.capacity()); try { -n = receiveFrame(*ws, payload.data(), payload.capacity(), flags); +n = ws->receiveFrame(payload.data(), payload.capacity(), flags); } catch (const Poco::TimeoutException&) { diff --git a/loolwsd/IoUtil.hpp b/loolwsd/IoUtil.hpp index dba0aa7..fca3107 100644 --- a/loolwsd/IoUtil.hpp +++ b/loolwsd/IoUtil.hpp @@ -18,11 +18,6 @@ namespace IoUtil { -// Wrapper for LOOLWebSocket::receiveFrame() that handles PING frames (by replying with a -// PONG frame) and PONG frames. PONG frames are ignored. -// Should we also factor out the handling of non-final and continuation frames into this? -// TODO: move this to LOOLWebSocket directly -int receiveFrame(LOOLWebSocket& socket, void* buffer, int length, int& flags); /// Synchronously process LOOLWebSocket requests and dispatch to handler. /// Handler returns false to end. diff --git a/loolwsd/LOOLWebSocket.hpp b/loolwsd/LOOLWebSocket.hpp index a8599f2..212990a 100644 --- a/loolwsd/LOOLWebSocket.hpp +++ b/loolwsd/LOOLWebSocket.hpp @@ -48,6 +48,31 @@ public: { } +// Wrapper for LOOLWebSocket::receiveFrame() that handles PING frames (by replying with a +// PONG frame) and PONG frames. PONG frames are ignored. +// Should we also factor out the handling of non-final and continuation frames into this? +int receiveFrame(char* buffer, int length, int& flags) +{ +for (;;) +{ +const int n = Poco::Net::WebSocket::receiveFrame(buffer, length, flags); +if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING) +{ +sendFrame(buffer, n, WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PONG); +} +else if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PONG) +{ +// In case we do send pongs in the future. +} +else +{ +return n; +} +} + +return -1; +} + /// Careful - sendFrame is _not_ virtual, we need to make sure that we use /// LOOLWebSocket all over the place /// It would be a kind of more natural to encapsulate Poco::Net::WebSocket diff --git a/loolwsd/Makefile.am b/loolwsd/Makefile.am index 9ab1f10..fd0efdc 100644 --- a/loolwsd/Makefile.am +++ b/loolwsd/Makefile.am @@ -83,7 +83,7 @@ looltool_SOURCES = LOOLTool.cpp loolstress_CPPFLAGS = -DTDOC=\"$(abs_top_srcdir)/test/data\" loolstress_SOURCES = LOOLStress.cpp \ LOOLProtocol.cpp \ -Log.cpp + Log.cpp noinst_HEADERS = Admin.hpp \ AdminModel.hpp \ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/LOOLProtocol.hpp loolwsd/LOOLWebSocket.hpp
loolwsd/LOOLProtocol.hpp |6 +++--- loolwsd/LOOLWebSocket.hpp |6 +- 2 files changed, 4 insertions(+), 8 deletions(-) New commits: commit 5d69d0abd608a447df0355152643608d8034b7a2 Author: Ashod Nakashian Date: Sat Nov 12 10:40:37 2016 -0500 loolwsd: log only abbreviated messages Change-Id: I3328a9171f8b85a802dc888de009bdbb8658cead Reviewed-on: https://gerrit.libreoffice.org/30815 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/LOOLProtocol.hpp b/loolwsd/LOOLProtocol.hpp index 2c158ff..e95090d 100644 --- a/loolwsd/LOOLProtocol.hpp +++ b/loolwsd/LOOLProtocol.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #define LOK_USE_UNSTABLE_API #include @@ -190,8 +190,8 @@ namespace LOOLProtocol return getAbbreviatedMessage(message.data(), message.size()); } -// Return a string dump of a LOOLWebSocket frame: Its opcode, length, first line (if present), -// flags. For human-readable logging purposes. Format not guaranteed to be stable. Not to be +// Return a string dump of a WebSocket frame: Its opcode, length, first line (if present), +// flags. For human-readable logging purposes. Format not guaranteed to be stable. Not to be // inspected programmatically. inline std::string getAbbreviatedFrameDump(const char *message, const int length, const int flags) diff --git a/loolwsd/LOOLWebSocket.hpp b/loolwsd/LOOLWebSocket.hpp index ffd4887..a8599f2 100644 --- a/loolwsd/LOOLWebSocket.hpp +++ b/loolwsd/LOOLWebSocket.hpp @@ -71,11 +71,7 @@ public: } int result = Poco::Net::WebSocket::sendFrame(buffer, length, flags); -// FIXME we want an abbreviated message here, but we'd have a circular -// dependency with LOOLProtocol, so use the full message here before -// we move getAbbreviatedMessage() to Log (where it belongs anyway). -//Log::debug("Sent frame: " + LOOLProtocol::getAbbreviatedMessage(static_cast(buffer), length)); -Log::debug("Sent frame: " + std::string(static_cast(buffer), length)); +Log::debug("Sent frame: " + LOOLProtocol::getAbbreviatedMessage(static_cast(buffer), length)); return result; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/test
loolwsd/test/httpcrashtest.cpp | 45 ++--- 1 file changed, 38 insertions(+), 7 deletions(-) New commits: commit d2d3bb19e0885d2c26176b236fc4fa9d77c34e16 Author: Ashod Nakashian Date: Fri Nov 11 22:38:14 2016 -0500 loolwsd: new unittest to test forkit crash recovery Change-Id: I61c79cce83af1fface2f54294d418c67eb6d398e Reviewed-on: https://gerrit.libreoffice.org/30814 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/test/httpcrashtest.cpp b/loolwsd/test/httpcrashtest.cpp index 3bd4bcd..fea8734 100644 --- a/loolwsd/test/httpcrashtest.cpp +++ b/loolwsd/test/httpcrashtest.cpp @@ -58,16 +58,18 @@ class HTTPCrashTest : public CPPUNIT_NS::TestFixture CPPUNIT_TEST(testBarren); CPPUNIT_TEST(testCrashKit); +CPPUNIT_TEST(testCrashForkit); CPPUNIT_TEST_SUITE_END(); void testCountHowManyLoolkits(); void testBarren(); void testCrashKit(); +void testCrashForkit(); void testNoExtraLoolKitsLeft(); static -void killLoKitProcesses(); +void killLoKitProcesses(const char* exec_filename); public: HTTPCrashTest() @@ -122,7 +124,7 @@ void HTTPCrashTest::testBarren() const auto testname = "barren "; try { -killLoKitProcesses(); +killLoKitProcesses("(loolkit)"); std::cerr << "Loading after kill." << std::endl; @@ -131,7 +133,6 @@ void HTTPCrashTest::testBarren() sendTextFrame(socket, "status", testname); assertResponseString(socket, "status:", testname); - } catch (const Poco::Exception& exc) { @@ -146,7 +147,7 @@ void HTTPCrashTest::testCrashKit() { auto socket = loadDocAndGetSocket("empty.odt", _uri, testname); -killLoKitProcesses(); +killLoKitProcesses("(loolkit)"); // We expect the client connection to close. // In the future we might restore the kit, but currently we don't. @@ -183,7 +184,36 @@ void HTTPCrashTest::testCrashKit() } } -void HTTPCrashTest::killLoKitProcesses() +void HTTPCrashTest::testCrashForkit() +{ +const auto testname = "crashForkit "; +try +{ +auto socket = loadDocAndGetSocket("empty.odt", _uri, testname); + +std::cerr << "Killing forkit." << std::endl; +killLoKitProcesses("(loolforkit)"); +std::cerr << "Communicating after kill." << std::endl; + +sendTextFrame(socket, "status", testname); +assertResponseString(socket, "status:", testname); + +// respond close frame +socket->shutdown(); + + +std::cerr << "Killing forkit." << std::endl; +killLoKitProcesses("(loolkit)"); +std::cerr << "Communicating after kill." << std::endl; +loadDocAndGetSocket("empty.odt", _uri, testname); +} +catch (const Poco::Exception& exc) +{ +CPPUNIT_FAIL(exc.displayText()); +} +} + +void HTTPCrashTest::killLoKitProcesses(const char* exec_filename) { // Crash all lokit processes. for (auto it = Poco::DirectoryIterator(std::string("/proc")); it != Poco::DirectoryIterator(); ++it) @@ -202,18 +232,19 @@ void HTTPCrashTest::killLoKitProcesses() { pid = 0; } + if (pid > 1 && endPos == fileName.length()) { Poco::FileInputStream stat(procEntry.toString() + "/stat"); std::string statString; Poco::StreamCopier::copyToString(stat, statString); Poco::StringTokenizer tokens(statString, " "); -if (tokens.count() > 3 && tokens[1] == "(loolkit)") +if (tokens.count() > 3 && tokens[1] == exec_filename) { std::cerr << "Killing " << pid << std::endl; if (kill(pid, SIGKILL) == -1) { -std::cerr << "kill(" << pid << ",SIGKILL) failed: " << std::strerror(errno) << std::endl; +std::cerr << "kill(" << pid << ", SIGKILL) failed: " << std::strerror(errno) << std::endl; } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loolwsd/test
loolwsd/test/countloolkits.hpp | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) New commits: commit ae3055c19ad4de84fbdbc8f1c559ba77a92b7718 Author: Ashod Nakashian Date: Fri Nov 11 22:23:05 2016 -0500 loolwsd: don't ignore zombies when counting loolkit processes During tests we need to count the number of oustanding loolkit processes. Since once a process dies its parents must first reap it to get removed from the proc table, we can't assume the process is fully removed until and unless it's reaped. In crash tests this becomes critical, since if we load docs right after intentionally killing loolkits, we will trick wsd into using a zombie process. It will then fail at first communication with the child. While this excercise early failure, in practice this is unrealistic and will force handling cases that in practice should not happen (or when they do, nothing too horrible will happen). By not counting zombies we can now wait in the crash tests until forkit reaps the kits, then we test the scenario where there are no ready children when documents are loaded. Change-Id: I0e5ca9a02d215ceca36d80071ba57e9a9c9c3240 Reviewed-on: https://gerrit.libreoffice.org/30813 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loolwsd/test/countloolkits.hpp b/loolwsd/test/countloolkits.hpp index d27ab3b..947604b 100644 --- a/loolwsd/test/countloolkits.hpp +++ b/loolwsd/test/countloolkits.hpp @@ -43,20 +43,22 @@ static int getLoolKitProcessCount() { switch (tokens[2].c_str()[0]) { +// Dead marker for old and new kernels. case 'x': -case 'X': // Kinds of dead-ness. -case 'Z': // zombies -break; // ignore +case 'X': +// Don't ignore zombies. +break; default: -result++; +++result; break; } // std::cout << "Process:" << pid << ", '" << tokens[1] << "'" << " state: " << tokens[2] << std::endl; } } } -catch (const Poco::Exception&) +catch (const std::exception& ex) { +std::cerr << "Error while iterating processes: " << ex.what() << std::endl; } } @@ -72,9 +74,9 @@ static int countLoolKitProcesses(const int expected) // information about a successful auto-save. In the HTTPWSTest::testConnectNoLoad() there is // nothing to auto-save, so it waits in vain. -// This does not need to depend on any constant from Common.hpp. The shorter the better (the -// quicker the test runs). -const auto sleepMs = 200; +// This does not need to depend on any constant from Common.hpp. +// The shorter the better (the quicker the test runs). +const auto sleepMs = 100; // This has to cause waiting for at least COMMAND_TIMEOUT_MS. Add one second for safety. const size_t repeat = ((COMMAND_TIMEOUT_MS + 1000) / sleepMs); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sd/source
sd/source/ui/func/fuconstr.cxx |9 - sd/source/ui/inc/fuconstr.hxx |6 ++ 2 files changed, 2 insertions(+), 13 deletions(-) New commits: commit fef32a42c8bd8fd640d6c9cdc2f839fb43ad490c Author: Caolán McNamara Date: Sun Nov 13 20:52:20 2016 + loplugin:unnecessaryoverride Change-Id: Ifcdbf71a2added62b325e1a6a848973320154435 diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index 2937fd2..1ead60c 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -212,15 +212,6 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) return bReturn; } -/** - * Process keyboard input - * @returns true if a KeyEvent is being processed, false otherwise - */ -bool FuConstruct::KeyInput(const KeyEvent& rKEvt) -{ -return FuDraw::KeyInput(rKEvt); -} - void FuConstruct::Activate() { mpView->SetEditMode(SdrViewEditMode::Create); diff --git a/sd/source/ui/inc/fuconstr.hxx b/sd/source/ui/inc/fuconstr.hxx index 6fe7219..91cb1e7 100644 --- a/sd/source/ui/inc/fuconstr.hxx +++ b/sd/source/ui/inc/fuconstr.hxx @@ -28,13 +28,11 @@ class SfxItemSet; namespace sd { -class FuConstruct -: public FuDraw +class FuConstruct : public FuDraw { public: -// Mouse- & Key-Events -virtual bool KeyInput(const KeyEvent& rKEvt) override; +// Mouse Events virtual bool MouseMove(const MouseEvent& rMEvt) override; virtual bool MouseButtonUp(const MouseEvent& rMEvt) override; virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source
cui/source/tabpages/tparea.cxx |4 1 file changed, 4 insertions(+) New commits: commit fd90e405888cb566c8064497ee04d31360480330 Author: Caolán McNamara Date: Sun Nov 13 20:47:42 2016 + coverity#1371441 Uninitialized pointer field Change-Id: Icabed9a27be9e34552531997818afd202f31114c diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 773d668..b58a306 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -84,6 +84,7 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs m_pHatchingList( nullptr ), m_pBitmapList( nullptr ), m_pPatternList( nullptr ), +mpDrawModel(nullptr), // local fixed not o be changed values for local pointers maFixed_ChangeType(ChangeType::NONE), @@ -94,7 +95,10 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs m_pnPatternListState(&maFixed_ChangeType), m_pnGradientListState(&maFixed_ChangeType), m_pnHatchingListState(&maFixed_ChangeType), +m_nPageType(PageType::Area), m_nPos(0), +m_nDlgType(0), +m_pbAreaTP(nullptr), m_aXFillAttr ( rInAttrs.GetPool() ), m_rXFSet ( m_aXFillAttr.GetItemSet() ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 69a3d753bb8ecc8f2001197546d721dfd92b83df Author: Olivier Hallot Date: Sun Nov 13 18:15:20 2016 -0200 Updated core Project: help e852c87f0bef8b19c4d733460bb10910a880e769 New element in online help + cleanups * Implementation of element in XHP files, with corresponding transformation in XSLT. Video objects maps to HTML5 and audio objects into elements. Generic maps to HTML5 (WIP) * CSS file with some cleanup and branding colors, includes the option to show debug info in .debug class. CSS fonts with recent changes. * Index.html file with new and better font rendering * help.js with info on top right about the page displayed * Cleanup of getbookmark.sh * New README with instructions Change-Id: I856b99308ee008d8607dd0ba60a446224cc26e58 Reviewed-on: https://gerrit.libreoffice.org/30812 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/helpcontent2 b/helpcontent2 index 106850a..e852c87 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 106850a265b62c6a85d713c20afe131844013f0a +Subproject commit e852c87f0bef8b19c4d733460bb10910a880e769 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: source/default.css source/get_bookmark.sh source/HELP-IN-BROWSER-README.txt source/index.html source/online_transform.xsl
source/HELP-IN-BROWSER-README.txt | 109 ++ source/default.css| 44 +-- source/get_bookmark.sh|4 - source/index.html | 21 +++ source/online_transform.xsl | 33 ++- 5 files changed, 178 insertions(+), 33 deletions(-) New commits: commit e852c87f0bef8b19c4d733460bb10910a880e769 Author: Olivier Hallot Date: Sun Nov 13 18:15:20 2016 -0200 New element in online help + cleanups * Implementation of element in XHP files, with corresponding transformation in XSLT. Video objects maps to HTML5 and audio objects into elements. Generic maps to HTML5 (WIP) * CSS file with some cleanup and branding colors, includes the option to show debug info in .debug class. CSS fonts with recent changes. * Index.html file with new and better font rendering * help.js with info on top right about the page displayed * Cleanup of getbookmark.sh * New README with instructions Change-Id: I856b99308ee008d8607dd0ba60a446224cc26e58 Reviewed-on: https://gerrit.libreoffice.org/30812 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot diff --git a/source/HELP-IN-BROWSER-README.txt b/source/HELP-IN-BROWSER-README.txt new file mode 100644 index 000..ab8f49a --- /dev/null +++ b/source/HELP-IN-BROWSER-README.txt @@ -0,0 +1,109 @@ +- +Helpcontent displayed in a browser directly from XML +- + +This README shows how to display Helpcontent2 XML pages (XHP) directly rendered in a modern browser. + +- +Background +- + +The XML files must be transformed into HTML files with the help of a style sheet file (XSL). + +In the current helpcontent2, the processing is done in xmlhelp/ module, an ancient XSLT processor developed circa 2005 (OpenOffice.org 1.5) + +Modern browsers such as Firefox, Chrome and Rekonq are capable to execute the transformation direcly in the client, by getting an URL that returns a XML file that contains the reference of the necessary XSL style sheet. + +How to display Helpcontent2 in a browser + +1. Open the browser +2. Open the file index.html in source/ folder +3. Navigate in pages + +- +File descriptions +- + +default.css: +- +the cascading style sheet for HTML formatting. + +index.html: +--- +The entry web page in the root folder of the server. Displays the #TopLeft with links to LibreOffice modules help libraries. + +online_transform.xsl: + +the XSL transform file. Transform XHP files into HTML files. + +This file is a modification of xmlhelper/util/main_transform.xsl, which was designed for xmlhelp XSL processor. + +The XSLT online_transform.xsl is used inside help.js. + +help.js +--- +This javascript file: +1. takes XHP files and online_transform.xsl and generates the HTML contents to be displayed in #DisplayArea . +2. picks the bookmarks file and displays in #BottomLeft area. +3. displays the XHP file patch and bookmark in the #TopRight area + +- +New âObjectâ tag +- + +The filter online_transform.xsl now support the tag defined for XHP files to allow a generic object in the browser. The tag now maps to the folowing HTML5 tags: +Maps to HTML5 tag: + + + + + +Maps to HTML5 tag: + + + + +Maps to HTML5 tag: + + + +- +How to build the LibreOffice Browser help +- + +1) Media files: Media files in helpcontent2 are located in module +icons-themes/ . It is necessary to copy core/icon-themes/galaxy into the media/ folder + +Note: For the moment, only Galaxy icon them is fully supported. + +2) Run the getbookmark.sh script to generate the bookmark index for the +LibreOffice Modules + +- +Folder layout. +- + +Root folder:source/ + default.css + online_transform.xsl + index.html + help.js + jquery-min.js + media/ + movies/ + screenshots/ + text/ + + +Notes: +1. the online_transform.xsl is main_transform.xsl of HC2 modified to accomodate the layou
[Libreoffice-commits] core.git: 2 commits - desktop/source editeng/source include/svl include/toolkit lotuswordpro/source oox/source package/source sc/source sd/source svl/qa svl/source svx/source sw/
desktop/source/app/sofficemain.cxx |4 +- editeng/source/editeng/editdoc.hxx |2 - include/svl/IndexedStyleSheets.hxx |6 +-- include/toolkit/controls/tabpagecontainer.hxx |2 - include/toolkit/controls/tkscrollbar.hxx |2 - include/toolkit/controls/unocontrols.hxx | 34 - lotuswordpro/source/filter/lwptblformula.hxx |4 +- oox/source/drawingml/shape.cxx |2 - package/source/zippackage/ZipPackageStream.cxx |2 - sc/source/filter/xml/xmlcelli.cxx |2 - sc/source/filter/xml/xmlconti.cxx |2 - sc/source/ui/view/cellsh4.cxx |4 +- sd/source/core/stlpool.cxx |4 +- sd/source/ui/func/fuconstr.cxx |2 - sd/source/ui/view/drviews9.cxx |2 - svl/qa/unit/items/test_IndexedStyleSheets.cxx |2 - svl/source/items/style.cxx |6 +-- svx/source/accessibility/AccessibleEmptyEditSource.cxx |2 - sw/qa/core/test_ToxTextGenerator.cxx |4 +- sw/source/core/tox/ToxTextGenerator.cxx|4 +- sw/source/ui/dbui/mmresultdialogs.cxx |4 +- sw/source/uibase/utlui/unotools.cxx|2 - toolkit/source/controls/tkspinbutton.cxx |2 - vcl/source/app/IconThemeScanner.cxx|4 +- vcl/source/uitest/uiobject.cxx |2 - xmlsecurity/source/pdfio/pdfverify.cxx |2 - 26 files changed, 54 insertions(+), 54 deletions(-) New commits: commit 3838475c2fbeb3c84c2ee96a1845893b20d9495a Author: David Tardon Date: Sun Nov 13 19:13:36 2016 +0100 drop extra semicolons Change-Id: Ie6713d1bdf0010e5bc0bb70ca995c4dd36408673 diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index 755da59..b0d155b 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -81,7 +81,7 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, { std::string ini_path = CrashReporter::getIniFileName(); std::ofstream minidump_file(ini_path, std::ios_base::app); -minidump_file << "DumpFile=" << descriptor.path() << "\n";; +minidump_file << "DumpFile=" << descriptor.path() << "\n"; minidump_file.close(); SAL_WARN("desktop", "minidump generated: " << descriptor.path()); return succeeded; @@ -97,7 +97,7 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id, // TODO: moggi: can we avoid this conversion std::wstring_convert> conv1; std::string aPath = conv1.to_bytes(std::wstring(path)) + conv1.to_bytes(std::wstring(id)) + ".dmp"; -minidump_file << "DumpFile=" << aPath << "\n";; +minidump_file << "DumpFile=" << aPath << "\n"; minidump_file.close(); SAL_WARN("desktop", "minidump generated: " << aPath); return succeeded; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 159dc64..f027cd1 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1136,7 +1136,7 @@ Reference< XShape > const & Shape::createAndInsert( if ( pFontRef->maPhClr.isUsed() ) { aCharStyleProperties.maFillProperties.maFillColor = pFontRef->maPhClr; - aCharStyleProperties.maFillProperties.moFillType.set(XML_solidFill);; + aCharStyleProperties.maFillProperties.moFillType.set(XML_solidFill); } } } diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 932a5af..f7b 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -177,7 +177,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCop // create temporary stream uno::Reference < io::XTempFile > xTempFile = io::TempFile::create(m_xContext); uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream(); -uno::Reference < io::XInputStream > xTempIn = xTempFile->getInputStream();; +uno::Reference < io::XInputStream > xTempIn = xTempFile->getInputStream(); uno::Reference < io::XSeekable > xTempSeek( xTempOut, UNO_QUERY_THROW ); // copy the raw stream to the temporary file starting from the current position diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 42780fd..abc6987 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1145,7 +1145,7 @@ void ScXMLTableRowCellContext::PutValueCell( con
[Libreoffice-commits] core.git: Branch 'distro/collabora/lov-5.2' - 9 commits - dictionaries helpcontent2 translations vcl/osx
dictionaries|2 +- helpcontent2|2 +- translations|2 +- vcl/osx/salinst.cxx |3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) New commits: commit 83adc9c35c74e0badc710d981405858b1179a327 Author: Tor Lillqvist Date: Sat Sep 24 00:13:45 2016 +0300 tdf#102382: nextEventMatchingMask should only be called from the Main Thread So don't then unless we are on the main thread. Change-Id: I6ba52ed7db5d73a4c1c6acf10bdf254a6f959da8 diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 3bbff24..9bb6570 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -736,6 +736,9 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType ) } } +if (![NSThread isMainThread]) +return false; + unsigned/*NSUInteger*/ nEventMask = 0; if( nType & VclInputFlags::MOUSE) nEventMask |= commit e4fc5f4084ec3c06054080c7d741293650e36fb3 Author: Christian Lohmaier Date: Fri Oct 28 14:35:11 2016 +0200 Updated core Project: translations 564e0552d0a99c02a1505509390a41edc9d0f510 update translations for 5.2.3 rc3 and force-fix errors using pocheck Change-Id: I2c2e3004679ce3758d87bf12726ecf9253c29258 diff --git a/translations b/translations index ec1ca91..564e055 16 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit ec1ca914d62125ac93e888bbc77e56e6bf93c8a5 +Subproject commit 564e0552d0a99c02a1505509390a41edc9d0f510 commit d0da577b6f91521d0b64c192418ab49fb54f4730 Author: Christian Lohmaier Date: Fri Oct 28 11:17:39 2016 +0200 Updated core Project: translations ec1ca914d62125ac93e888bbc77e56e6bf93c8a5 revert accidental commit to Slovenain translation This (partially) reverts commit 3997f3b634be28bfe7ad52abd46067798a8f227a. Change-Id: I8b3d33346427f4dd06f870598c002389acd4d5cb diff --git a/translations b/translations index 8e8e7ce..ec1ca91 16 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 8e8e7cee18581cfe2923246eba9e0b7edff71326 +Subproject commit ec1ca914d62125ac93e888bbc77e56e6bf93c8a5 commit d1889ba98a1b1a66079b85bb8bc9f2dfe805280a Author: Christian Lohmaier Date: Tue Oct 11 21:38:52 2016 +0200 Updated core Project: translations 8e8e7cee18581cfe2923246eba9e0b7edff71326 update translations for 5.2.3 rc1 and force-fix errors using pocheck Change-Id: I3c922e1b91581f1b5cd6a5b8d0662a3e7aba0fae (cherry picked from commit 4a45b12af9d0be41780e5a29b73e8e595f3f430f) diff --git a/translations b/translations index 3997f3b..8e8e7ce 16 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 3997f3b634be28bfe7ad52abd46067798a8f227a +Subproject commit 8e8e7cee18581cfe2923246eba9e0b7edff71326 commit a1dad857cea16f5925794cde0ed67c99ad8b74a1 Author: jan Iversen Date: Sun Oct 9 12:08:51 2016 +0200 Updated core Project: translations 3997f3b634be28bfe7ad52abd46067798a8f227a pootle update Change-Id: Idb289de371f61cb434835da13d9269cc3db23988 diff --git a/translations b/translations index 1754718..3997f3b 16 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 1754718df8df5b391008ce7bed9cab978966e37a +Subproject commit 3997f3b634be28bfe7ad52abd46067798a8f227a commit 2dc8119286da394be04911696809ebc88872b067 Author: Andras Timar Date: Mon Oct 3 19:54:26 2016 +0200 Updated core Project: dictionaries a5ac3e1d730e3fb84b2cc9c4108effeee613c6d2 Update pt_PT dictionary to version 16.10.1.2 Change-Id: I0f66f15b594bebaefc2b8ffbc26bff5450ebf292 Reviewed-on: https://gerrit.libreoffice.org/29510 Reviewed-by: Tiago Santos Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/dictionaries b/dictionaries index 6417dbd..a5ac3e1 16 --- a/dictionaries +++ b/dictionaries @@ -1 +1 @@ -Subproject commit 6417dbd05e13c2e1165751feb2bc7866328dec2d +Subproject commit a5ac3e1d730e3fb84b2cc9c4108effeee613c6d2 commit f53d0f0a2331e06841a7899dd7e8cc631bafb45e Author: Christian Lohmaier Date: Sat Sep 10 10:08:17 2016 +0200 Updated core Project: help a80d1d6a3082e17138945c2294d654d5e05de572 replace "also :" by "also:" reported via pootle feedback Change-Id: I075ba046e72791ac44d37580972ee270134c4a35 Reviewed-on: https://gerrit.libreoffice.org/28797 Reviewed-by: Christian Lohmaier Tested-by: Christian Lohmaier (cherry picked from commit 6c8c4a5e044c5c22ca3acc7d968b096340562627) Reviewed-on: https://gerrit.libreoffice.org/28798 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/helpcontent2 b/helpcontent2 index 3f4fadf..a80d1d6 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 3f4fadf4e649f0b196c131ecc51e09921e35da85 +Subproject commit a80d1d6a3082e17138945c2294d654d5e05de572 commit 950c5288a6ecef645b8cbe393fbb6e0655302c5a Author: Jan Iversen Date: Tue Sep 6 22
[Libreoffice-commits] core.git: svl/source
svl/source/items/IndexedStyleSheets.cxx |5 - 1 file changed, 5 deletions(-) New commits: commit a21d24ca72b792c9fdd74894ebf773c72fc2b704 Author: David Tardon Date: Sun Nov 13 19:01:44 2016 +0100 revert unintentionally committed lines Change-Id: I5cb355af20f18e63fdfe45e5946a9281fd1fa084 diff --git a/svl/source/items/IndexedStyleSheets.cxx b/svl/source/items/IndexedStyleSheets.cxx index fa68f49..6bc4ad0 100644 --- a/svl/source/items/IndexedStyleSheets.cxx +++ b/svl/source/items/IndexedStyleSheets.cxx @@ -90,7 +90,6 @@ IndexedStyleSheets::GetNumberOfStyleSheets() const void IndexedStyleSheets::AddStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style) { -assert(!style->GetName().isEmpty()); if (!HasStyleSheet(style)) { mStyleSheets.push_back(style); // since we just added an element to the vector, we can safely do -1 as it will always be >= 1 @@ -101,7 +100,6 @@ IndexedStyleSheets::AddStyleSheet(const rtl::Reference< SfxStyleSheetBase >& sty bool IndexedStyleSheets::RemoveStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style) { -assert(!style->GetName().isEmpty()); rtl::OUString styleName = style->GetName(); std::vector positions = FindPositionsByName(styleName); bool found = false; @@ -201,7 +199,6 @@ void IndexedStyleSheets::Clear(StyleSheetDisposer& disposer) { for (VectorType::iterator it = mStyleSheets.begin(); it != mStyleSheets.end(); ++it) { -assert(!(*it)->GetName().isEmpty()); disposer.Dispose(*it); } mStyleSheets.clear(); @@ -210,8 +207,6 @@ IndexedStyleSheets::Clear(StyleSheetDisposer& disposer) IndexedStyleSheets::~IndexedStyleSheets() { -for (const auto& rStyleSheet : mStyleSheets) -assert(!rStyleSheet->GetName().isEmpty()); } bool ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] dev-tools.git: esc-reporting/esc-analyze.py
esc-reporting/esc-analyze.py | 96 +-- 1 file changed, 84 insertions(+), 12 deletions(-) New commits: commit f4dfbe0e8993cfb1a785cfe8e1b2dab03598a5d7 Author: jan Iversen Date: Sun Nov 13 18:40:22 2016 +0100 esc-reporting update, to upgrade old statistics diff --git a/esc-reporting/esc-analyze.py b/esc-reporting/esc-analyze.py index e613289..6dc2c0a 100755 --- a/esc-reporting/esc-analyze.py +++ b/esc-reporting/esc-analyze.py @@ -221,6 +221,8 @@ def analyze_mentoring(statList, openhubData, gerritData, gitData, bugzillaData, if row['status'] == 'SUBMITTED' or row['status'] == 'DRAFT': row['status'] = 'NEW' xDate = datetime.datetime.strptime(row['updated'], '%Y-%m-%d %H:%M:%S.%f000') + if xDate > cfg['cutDate']: +continue ownerEmail = util_check_mail(row['owner']['name'], row['owner']['email'], statList, cfg['contributor']['combine-email']) statList['people'][ownerEmail]['gerrit']['userName'] = row['owner']['username'] util_build_period_stat(cfg, statList, xDate, ownerEmail, row['status'], 'owner') @@ -245,6 +247,8 @@ def analyze_mentoring(statList, openhubData, gerritData, gitData, bugzillaData, for key in gitData['commits']: row = gitData['commits'][key] xDate = datetime.datetime.strptime(row['date'], "%Y-%m-%d %H:%M:%S") + if xDate > cfg['cutDate']: +continue if xDate < statOldDate: statOldDate = xDate if xDate > statNewDate: @@ -282,6 +286,8 @@ def analyze_mentoring(statList, openhubData, gerritData, gitData, bugzillaData, continue xDate = datetime.datetime.strptime(row['last_change_time'], "%Y-%m-%dT%H:%M:%SZ") + if xDate > cfg['cutDate']: +continue if xDate < statOldDate: statOldDate = xDate if xDate > statNewDate: @@ -317,6 +323,10 @@ def analyze_ui(statList, openhubData, gerritData, gitData, bugzillaData, cfg): if row['status'] == 'RESOLVED' or row['status'] == 'VERIFIED' or not 'topicUI' in row['keywords']: continue + xDate = datetime.datetime.strptime(row['last_change_time'], "%Y-%m-%dT%H:%M:%SZ") + if xDate > cfg['cutDate']: +continue + statList['data']['ui']['topicUI'] += 1 if 'needsUXEval' in row['keywords']: statList['data']['ui']['needsUXEval'] += 1 @@ -343,6 +353,9 @@ def analyze_qa(statList, openhubData, gerritData, gitData, bugzillaData, cfg): for key, row in bugzillaData['bugs'].items(): email = util_check_mail('*UNKNOWN*', row['creator'], statList, cfg['contributor']['combine-email']) xDate = datetime.datetime.strptime(row['last_change_time'], "%Y-%m-%dT%H:%M:%SZ") + if xDate > cfg['cutDate']: +continue + util_build_period_stat(cfg, statList, xDate, email, row['status'], 'owner', base='qa') for change in row['comments']: @@ -368,17 +381,18 @@ def analyze_final(statList, cfg): person['newestCommit'] = person['newestCommit'].strftime("%Y-%m-%d") person['prevCommit'] = person['prevCommit'].strftime("%Y-%m-%d") -myDay = datetime.date.today() +myDay = cfg['nowDate'] x = (myDay - datetime.timedelta(days=7)).strftime('%Y-%m-%d') weekList = util_load_file(cfg['homedir'] + 'archive/stats_' + x + '.json') if weekList is None: weekList = {'data': {}} statList['diff'] = util_build_diff(statList['data'], weekList['data']) -util_dump_file(cfg['homedir'] + 'stats.json', statList) +sFile = cfg['homedir'] + 'stats.json' +util_dump_file(sFile, statList) x = myDay.strftime('%Y-%m-%d') -util_dump_file(cfg['homedir'] + 'archive/stats_' + x + '.json', statList) +os.system('cp '+ sFile + ' ' + cfg['homedir'] + 'archive/stats_' + x + '.json') if myDay.strftime('%w') == '4': - util_dump_file(cfg['homedir'] + 'weeks/week_' + myDay.strftime('%Y_%W') + '.json', statList) +os.system('cp ' + sFile + ' ' + cfg['homedir'] + 'weeks/week_' + myDay.strftime('%Y_%W') + '.json') @@ -394,7 +408,7 @@ def runCfg(platform): cfg['contributor'] = util_load_data_file(cfg['homedir'] + 'dump/developers_dump.json') cfg['nowDate'] = datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) -cfg['cutDate'] = cfg['nowDate'] - datetime.timedelta(days=365) +cfg['cutDate'] = cfg['nowDate'] cfg['1weekDate'] = cfg['nowDate'] - datetime.timedelta(days=7) cfg['1monthDate'] = cfg['nowDate'] - datetime.timedelta(days=30) cfg['3monthDate'] = cfg['nowDate'] - datetime.timedelta(days=90) @@ -403,12 +417,7 @@ def runCfg(platform): -def runAnalyze(cfg): -openhubData = util_load_data_file(cfg['homedir'] + 'dump/openhub_dump.json') -bugzillaData = util_load_data_file(cfg['homedir'] + 'dump/bugzilla_dump.json') -gerritData = util_load_data_file(cfg['homedir'] + 'dump/gerrit_dump.json') -gitData = util_load_data_file(cfg['homedir'] + 'dump/git_
[Libreoffice-commits] core.git: 3 commits - vcl/quartz vcl/unx
vcl/quartz/ctfonts.cxx |6 +- vcl/quartz/salgdi.cxx | 67 +++-- vcl/unx/generic/glyphs/freetype_glyphcache.cxx |8 -- 3 files changed, 37 insertions(+), 44 deletions(-) New commits: commit ebfe8bb2b2cfc3dba063260bf746db923a3693f2 Author: Khaled Hosny Date: Sun Nov 13 18:59:44 2016 +0200 tdf#103895: Another fix too macOS glyph bounding Apply font rotation when calculating glyph bounding rectangle. Change-Id: I9c533ec3b33a5858d46b60d1700a50d3b6f915a4 diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 20fba1f..c111613 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -167,7 +167,11 @@ bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.11 kCTFontDefaultOrientation const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation; // TODO: horz/vert SAL_WNODEPRECATED_DECLARATIONS_POP -const CGRect aCGRect = CTFontGetBoundingRectsForGlyphs( aCTFontRef, aFontOrientation, &nCGGlyph, nullptr, 1 ); +CGRect aCGRect = CTFontGetBoundingRectsForGlyphs(aCTFontRef, aFontOrientation, &nCGGlyph, nullptr, 1); + +// Apply font rotation to non-upright glyphs. +if (mfFontRotation && !(aGlyphId & GF_ROTMASK)) +aCGRect = CGRectApplyAffineTransform(aCGRect, CGAffineTransformMakeRotation(mfFontRotation)); rRect.Left() = lrint( aCGRect.origin.x ); rRect.Top()= lrint(-aCGRect.origin.y ); commit e760de7db53a6ccfa0b4732d9c4639441dc22434 Author: Khaled Hosny Date: Sun Nov 13 18:36:35 2016 +0200 The nAngle is set but never used Change-Id: I7c8493e06ab3d7bab60f5af14100b1e25dd68fba diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx index 5dff458..7ef42b8 100644 --- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx +++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx @@ -753,9 +753,8 @@ static inline void SplitGlyphFlags( const FreetypeFont& rFont, sal_GlyphId& rGly void FreetypeFont::ApplyGlyphTransform( int nGlyphFlags, FT_Glyph pGlyphFT ) const { -int nAngle = GetFontSelData().mnOrientation; // shortcut most common case -if( !nAngle && !nGlyphFlags ) +if (!GetFontSelData().mnOrientation && !nGlyphFlags) return; const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics; @@ -775,7 +774,6 @@ void FreetypeFont::ApplyGlyphTransform( int nGlyphFlags, FT_Glyph pGlyphFT ) con aMatrix.yx = +mnSin; break; case GF_ROTL:// left -nAngle += 900; bStretched = (mfStretch != 1.0); aVector.x = (FT_Pos)(+rMetrics.descender * mfStretch); aVector.y = -rMetrics.ascender; @@ -785,7 +783,6 @@ void FreetypeFont::ApplyGlyphTransform( int nGlyphFlags, FT_Glyph pGlyphFT ) con aMatrix.yx = (FT_Pos)(+mnCos / mfStretch); break; case GF_ROTR:// right -nAngle -= 900; bStretched = (mfStretch != 1.0); aVector.x = -maFaceFT->glyph->metrics.horiAdvance; aVector.x += (FT_Pos)(rMetrics.descender * mnSin/65536.0); @@ -797,9 +794,6 @@ void FreetypeFont::ApplyGlyphTransform( int nGlyphFlags, FT_Glyph pGlyphFT ) con break; } -while( nAngle < 0 ) -nAngle += 3600; - if( pGlyphFT->format != FT_GLYPH_FORMAT_BITMAP ) { FT_Glyph_Transform( pGlyphFT, nullptr, &aVector ); commit 3a64e01a7e2ac65daa4f3fa623d9ef5b9ca24f7f Author: Khaled Hosny Date: Sun Nov 13 16:00:34 2016 +0200 Simplify vertical text drawing on macOS Rotate only the rotated glyphs instead of rotating everything, then unrotating the upright glyphs. No need for a rotated font either, rotating the graphics is fine. Change-Id: I1fce2c9c6a29abb1353a5fc8485a9c0d34edfbf1 diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 91454c7..7daefd5 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -430,31 +430,39 @@ void AquaSalGraphics::DrawSalLayout(const CommonSalLayout& rLayout) return; CTFontRef pFont = static_cast(CFDictionaryGetValue(rStyle.GetStyleDict(), kCTFontAttributeName)); +CGAffineTransform aRotMatrix = CGAffineTransformMakeRotation(-rStyle.mfFontRotation); Point aPos; sal_GlyphId aGlyphId; std::vector aGlyphIds; std::vector aGlyphPos; -std::vector aGlyphRotation; +std::vector aGlyphOrientation; int nStart = 0; while (rLayout.GetNextGlyphs(1, &aGlyphId, aPos, nStart)) { -// Transform the position of non-vertical glyphs. -CGAffineTransform aMatrix = CGAffineTransformMakeRotation(-rStyle.mfFontRotation); +CGPoint aGCPos = CGPointMake(aPos.X(), -aPos.Y()); -// Transform the position of vertical glyphs. -// We donât handle GF_ROTR as it is not used in CommonSalLayout. -bool nGlyphRot
[Libreoffice-commits] core.git: sfx2/qa sot/qa
sfx2/qa/cppunit/test_metadatable.cxx | 40 +-- sot/qa/cppunit/test_sot.cxx | 18 +++ 2 files changed, 29 insertions(+), 29 deletions(-) New commits: commit c622982a7a85007b4f40b101643c638adb8651db Author: Miklos Vajna Date: Fri Nov 11 08:58:43 2016 +0100 sot: fix loplugin:cppunitassertequals warnings Change-Id: Ib4ec7d5c3dc89c80cc46bbbe8a14f6b1393ffa76 Reviewed-on: https://gerrit.libreoffice.org/30767 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx index 91d3872..895b6a7 100644 --- a/sfx2/qa/cppunit/test_metadatable.cxx +++ b/sfx2/qa/cppunit/test_metadatable.cxx @@ -100,24 +100,24 @@ void MetadatableTest::test() beans::StringPair id3e(empty, sid3); beans::StringPair id4e(empty, sid4); m1.SetMetadataReference(id1); -CPPUNIT_ASSERT_MESSAGE("set failed", m1.GetMetadataReference() == id1); +CPPUNIT_ASSERT_MESSAGE("set failed", bool(m1.GetMetadataReference() == id1)); try { m2.SetMetadataReference(id1); CPPUNIT_ASSERT_MESSAGE("set duplicate succeeded", false); } catch (const lang::IllegalArgumentException &) { } m1.SetMetadataReference(id1); CPPUNIT_ASSERT_MESSAGE("set failed (existing)", -m1.GetMetadataReference() == id1); +bool(m1.GetMetadataReference() == id1)); m1.EnsureMetadataReference(); CPPUNIT_ASSERT_MESSAGE("ensure failed (existing)", -m1.GetMetadataReference() == id1); +bool(m1.GetMetadataReference() == id1)); m2.EnsureMetadataReference(); beans::StringPair m2id(m2.GetMetadataReference()); CPPUNIT_ASSERT_MESSAGE("ensure failed", !m2id.Second.isEmpty()); m2.EnsureMetadataReference(); CPPUNIT_ASSERT_MESSAGE("ensure failed (idempotent)", -m2.GetMetadataReference() == m2id); +bool(m2.GetMetadataReference() == m2id)); m1.m_bInUndo = true; CPPUNIT_ASSERT_MESSAGE("move to undo failed", @@ -125,7 +125,7 @@ void MetadatableTest::test() m1.m_bInUndo = false; CPPUNIT_ASSERT_MESSAGE("move from undo failed", -m1.GetMetadataReference() == id1); +bool(m1.GetMetadataReference() == id1)); m1.m_bInUndo = true; try { @@ -138,23 +138,23 @@ void MetadatableTest::test() m1.GetMetadataReference().Second.isEmpty()); m3.RegisterAsCopyOf(m2); -CPPUNIT_ASSERT_MESSAGE("copy: source", m2.GetMetadataReference() == id1); +CPPUNIT_ASSERT_MESSAGE("copy: source", bool(m2.GetMetadataReference() == id1)); CPPUNIT_ASSERT_MESSAGE("copy: duplicate", m3.GetMetadataReference().Second.isEmpty()); m4.RegisterAsCopyOf(m3); -CPPUNIT_ASSERT_MESSAGE("copy: source", m2.GetMetadataReference() == id1); +CPPUNIT_ASSERT_MESSAGE("copy: source", bool(m2.GetMetadataReference() == id1)); CPPUNIT_ASSERT_MESSAGE("copy: duplicate", m3.GetMetadataReference().Second.isEmpty()); CPPUNIT_ASSERT_MESSAGE("copy: duplicate", m4.GetMetadataReference().Second.isEmpty()); m2.m_bInUndo = true; CPPUNIT_ASSERT_MESSAGE("duplicate to undo", -m3.GetMetadataReference() == id1); +bool(m3.GetMetadataReference() == id1)); CPPUNIT_ASSERT_MESSAGE("duplicate to undo", m2.GetMetadataReference().Second.isEmpty()); m2.m_bInUndo = false; CPPUNIT_ASSERT_MESSAGE("duplicate from undo", -m2.GetMetadataReference() == id1); +bool(m2.GetMetadataReference() == id1)); CPPUNIT_ASSERT_MESSAGE("duplicate from undo", m3.GetMetadataReference().Second.isEmpty()); @@ -171,23 +171,23 @@ void MetadatableTest::test() MockMetadatable m3p(*pReg); mc1.SetMetadataReference(id2); -CPPUNIT_ASSERT_MESSAGE("set failed", mc1.GetMetadataReference() == id2); +CPPUNIT_ASSERT_MESSAGE("set failed", bool(mc1.GetMetadataReference() == id2)); try { mc2.SetMetadataReference(id2); CPPUNIT_FAIL("set duplicate succeeded"); } catch (const lang::IllegalArgumentException &) { } mc1.SetMetadataReference(id2); CPPUNIT_ASSERT_MESSAGE("set failed (existing)", -mc1.GetMetadataReference() == id2); +bool(mc1.GetMetadataReference() == id2)); mc1.EnsureMetadataReference(); CPPUNIT_ASSERT_MESSAGE("ensure failed (existing)", -mc1.GetMetadataReference() == id2); +bool(mc1.GetMetadataReference() == id2)); mc2.EnsureMetadataReference(); beans::StringPair mc2id(mc2.GetMetadataReference()); CPPUNIT_ASSERT_MESSAGE("ensure failed", !mc2id.Second.isEmpty()); mc2.EnsureMetadataReference(); CPPUNIT_ASSERT_MESSAGE("ensure failed (idempotent)", -mc2.GetMetadataReference() == mc2id); +bool(mc2.GetMetadataReference() == mc2id)); mc2.RemoveMetadat
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdmark.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ae922863c4932be38ef53ae5e985a668724e8f15 Author: Caolán McNamara Date: Sat Nov 12 21:12:27 2016 + if we're empty, we're back to initial 'sorted' state Change-Id: Id85c670ab40d9d0e9848f91f4f2d14212f52c1a1 Reviewed-on: https://gerrit.libreoffice.org/30795 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx index 3f1db23..7db7bbb 100644 --- a/svx/source/svdraw/svdmark.cxx +++ b/svx/source/svdraw/svdmark.cxx @@ -213,8 +213,8 @@ void SdrMarkList::Clear() SdrMark* pMark = GetMark(i); delete pMark; } - maList.clear(); +mbSorted = true; //we're empty, so can be considered sorted SetNameDirty(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/form/fmvwimp.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit bf5eef2415fb84a1c885c8f74a22e575de6971fe Author: Caolán McNamara Date: Sat Nov 12 21:13:40 2016 + coverity#1371152 Missing move assignment operator Change-Id: I7cf3ed2c1cd392b149d21ee884aac695d5d01be2 Reviewed-on: https://gerrit.libreoffice.org/30796 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 705b9b1..f2defdd 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1762,7 +1762,6 @@ void FmXFormView::startMarkListWatching() } } - void FmXFormView::saveMarkList() { if ( m_pView ) @@ -1802,11 +1801,10 @@ void FmXFormView::saveMarkList() else { OSL_FAIL( "FmXFormView::saveMarkList: invalid view!" ); -m_aMark = SdrMarkList(); +m_aMark.Clear(); } } - static bool lcl_hasObject( SdrObjListIter& rIter, SdrObject* pObj ) { bool bFound = false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/sdi sw/source
sw/sdi/_frmsh.sdi |7 +++ sw/source/uibase/shells/frmsh.cxx | 25 - 2 files changed, 31 insertions(+), 1 deletion(-) New commits: commit c3c08a16f8317266bcb86041d812d8a9821c237f Author: Gulsah Kose Date: Thu Nov 10 17:32:11 2016 +0300 tdf#103268 Activate editing object name function for writer images. Change-Id: Idfe88a3f5b7492dc6ac71fa3791839a000a7483b Signed-off-by: Gulsah Kose Reviewed-on: https://gerrit.libreoffice.org/30759 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/sw/sdi/_frmsh.sdi b/sw/sdi/_frmsh.sdi index e496cecf..2ccb88f 100644 --- a/sw/sdi/_frmsh.sdi +++ b/sw/sdi/_frmsh.sdi @@ -369,6 +369,13 @@ interface BaseTextFrame StateMethod = GetState ; DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; ] +// tdf#103268 +FN_NAME_SHAPE +[ +ExecMethod = Execute ; +StateMethod = GetState ; +DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; +] // Abfragefunktionen fuer ImageMaps // Slots ohne Export diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 764d004..3b962a7 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -614,6 +614,29 @@ void SwFrameShell::Execute(SfxRequest &rReq) rReq.SetReturnValue(SfxBoolItem(nSlot, bMirror)); } break; +case FN_NAME_SHAPE: +{ +bUpdateMgr = false; +SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList(); +if ( pSdrView && + pSdrView->GetMarkedObjectCount() == 1 ) +{ +OUString aName(rSh.GetFlyName()); +SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); +assert(pFact); +ScopedVclPtr pDlg( +pFact->CreateSvxObjectNameDialog( aName )); + +assert(pDlg); + +if ( pDlg->Execute() == RET_OK ) +{ +pDlg->GetName(aName); +rSh.SetFlyName(aName); +} +} +} +break; // #i73249# case FN_TITLE_DESCRIPTION_SHAPE: { @@ -917,6 +940,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet) break; // #i73249# case FN_TITLE_DESCRIPTION_SHAPE: +case FN_NAME_SHAPE: { SwWrtShell &rWrtSh = GetShell(); SdrView* pSdrView = rWrtSh.GetDrawViewWithValidMarkList(); @@ -925,7 +949,6 @@ void SwFrameShell::GetState(SfxItemSet& rSet) { rSet.DisableItem( nWhich ); } - } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - configure.ac svl/source writerperfect/CppunitTest_writerperfect_draw.mk
configure.ac| 89 +--- svl/source/items/IndexedStyleSheets.cxx |9 +- writerperfect/CppunitTest_writerperfect_draw.mk |3 3 files changed, 32 insertions(+), 69 deletions(-) New commits: commit 33ae095d92246cd2c74c30c9e070a8e0241926db Author: David Tardon Date: Sun Nov 13 15:03:03 2016 +0100 add missing dependency Change-Id: I72696c82d9a96709746060ae18bd497da8715d35 diff --git a/svl/source/items/IndexedStyleSheets.cxx b/svl/source/items/IndexedStyleSheets.cxx index 260ae10..fa68f49 100644 --- a/svl/source/items/IndexedStyleSheets.cxx +++ b/svl/source/items/IndexedStyleSheets.cxx @@ -53,7 +53,6 @@ IndexedStyleSheets::IndexedStyleSheets() } ;} - void IndexedStyleSheets::Register(const SfxStyleSheetBase& style, unsigned pos) { @@ -91,6 +90,7 @@ IndexedStyleSheets::GetNumberOfStyleSheets() const void IndexedStyleSheets::AddStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style) { +assert(!style->GetName().isEmpty()); if (!HasStyleSheet(style)) { mStyleSheets.push_back(style); // since we just added an element to the vector, we can safely do -1 as it will always be >= 1 @@ -101,6 +101,7 @@ IndexedStyleSheets::AddStyleSheet(const rtl::Reference< SfxStyleSheetBase >& sty bool IndexedStyleSheets::RemoveStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style) { +assert(!style->GetName().isEmpty()); rtl::OUString styleName = style->GetName(); std::vector positions = FindPositionsByName(styleName); bool found = false; @@ -200,6 +201,7 @@ void IndexedStyleSheets::Clear(StyleSheetDisposer& disposer) { for (VectorType::iterator it = mStyleSheets.begin(); it != mStyleSheets.end(); ++it) { +assert(!(*it)->GetName().isEmpty()); disposer.Dispose(*it); } mStyleSheets.clear(); @@ -207,7 +209,10 @@ IndexedStyleSheets::Clear(StyleSheetDisposer& disposer) } IndexedStyleSheets::~IndexedStyleSheets() -{;} +{ +for (const auto& rStyleSheet : mStyleSheets) +assert(!rStyleSheet->GetName().isEmpty()); +} bool IndexedStyleSheets::HasStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style) const diff --git a/writerperfect/CppunitTest_writerperfect_draw.mk b/writerperfect/CppunitTest_writerperfect_draw.mk index 442fef4..24f7ce4 100644 --- a/writerperfect/CppunitTest_writerperfect_draw.mk +++ b/writerperfect/CppunitTest_writerperfect_draw.mk @@ -42,4 +42,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,writerperfect_draw,\ writerperfect/qa/unit/WpftDrawFilterTest \ )) +$(call gb_CppunitTest_get_target,writerperfect_draw): \ +$(call gb_AllLangResTarget_get_target,sd) + # vim: set noet sw=4 ts=4: commit a64958ab631a81feda8a42807b17fda6cb29147e Author: David Tardon Date: Sat Nov 12 10:25:40 2016 +0100 move all tests for DLP libs to one place Change-Id: Icbce7f5512c0c205f44db520f337ce9520d228d5 diff --git a/configure.ac b/configure.ac index 1c1c87f..a5ffd99 100644 --- a/configure.ac +++ b/configure.ac @@ -7840,7 +7840,7 @@ fi AC_SUBST([ENABLE_EOT]) dnl === -dnl Check for system librevenge +dnl Check for DLP libs dnl === AS_IF([test "$COM" = "MSC"], [librevenge_libdir="${WORKDIR}/LinkTarget/Library"], @@ -7848,66 +7848,46 @@ AS_IF([test "$COM" = "MSC"], ) libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"]) -dnl === -dnl Check for system libe-book -dnl === -libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1]) -libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2]) +libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1]) -dnl === -dnl Check for system libetonyek -dnl === -libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1]) -libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.5]) +AS_IF([test "$COM" = "MSC"], + [libwpd_libdir="${WORKDIR}/LinkTarget/Library"], + [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"] +) +libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"]) -dnl === -dnl Check for system libfreehand -dnl === -libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1]) +libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3]) -dnl === -
[Libreoffice-commits] core.git: vcl/quartz
vcl/quartz/salgdi.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit 24707c7b8d5e7b3d72decb9749b83153b273917f Author: Khaled Hosny Date: Sun Nov 13 14:24:39 2016 +0200 Fix build Change-Id: I55db5ba855b8d72e9be0298a68b094c7b01d9f54 diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index cb885c0..91454c7 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -128,8 +128,6 @@ sal_IntPtr CoreTextFontFace::GetFontId() const return (sal_IntPtr)mnFontId; } -static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);} - const FontCharMapRef CoreTextFontFace::GetFontCharMap() const { // return the cached charmap ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Marina Latini license statement
All of my past & future contributions to LibreOffice may be licensed under the MPLv2/LGPLv3+ dual license. -- Marina Latini IRC: deneb_alpha on Freenode GPG key "ID" 0xF010C774 - DAEC 51E7 4316 5FAE EAE0 F256 3DB8 2837 F010 C774 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: Branch 'distro/collabora/lov-5.2' - 169 commits - accessibility/inc accessibility/source basic/qa basic/source canvas/source chart2/source config_host.mk.in configure.a
Makefile.in |2 RepositoryExternal.mk | 24 accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx |2 accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx | 16 accessibility/source/standard/vclxaccessiblelist.cxx|4 accessibility/source/standard/vclxaccessiblelistitem.cxx| 82 basic/qa/cppunit/test_vba.cxx |6 basic/source/runtime/stdobj.cxx |1 canvas/source/cairo/cairo_canvashelper.cxx |5 chart2/source/controller/main/ChartController.cxx |7 chart2/source/controller/sidebar/ChartElementsPanel.cxx |3 config_host.mk.in |2 configure.ac| 27 connectivity/source/drivers/firebird/DatabaseMetaData.cxx |4 cui/source/tabpages/border.cxx |2 cui/source/tabpages/transfrm.cxx|8 cui/uiconfig/ui/numberingoptionspage.ui | 20 desktop/source/app/opencl.cxx |3 download.lst| 10 drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |1 editeng/source/items/frmitems.cxx | 12 editeng/source/misc/svxacorr.cxx| 18 embeddedobj/source/commonembedding/visobj.cxx |5 embeddedobj/source/msole/olecomponent.cxx | 17 embeddedobj/source/msole/olevisual.cxx | 16 embedserv/source/embed/docholder.cxx|2 external/coinmp/ExternalProject_coinmp.mk |1 external/curl/ExternalPackage_curl.mk |2 external/curl/ExternalProject_curl.mk |2 external/curl/UnpackedTarball_curl.mk |3 external/curl/curl-7.26.0_win-proxy.patch | 45 external/curl/curl-freebsd.patch.1 | 32 external/curl/curl-msvc-schannel.patch.1|4 external/curl/curl-msvc.patch.1 | 12 external/jpeg-turbo/jpeg-turbo.win_build.patch.1| 28 external/mdds/UnpackedTarball_mdds.mk |1 external/mdds/tdf90579.patch.0 | 23 external/nss/ExternalPackage_nss.mk |5 external/nss/UnpackedTarball_nss.mk |1 external/nss/clang-cl.patch.0 |4 external/nss/nss-winXP-sdk.patch.1 |5 external/nss/nss.nowerror.patch |8 external/nss/nss.patch | 26 external/nss/nss.windowbuild.patch.0| 55 external/nss/nss.windows.patch |6 external/nss/nss_macosx.patch | 10 external/nss/ubsan.patch.0 | 29 external/poppler/ExternalProject_poppler.mk |2 external/poppler/UnpackedTarball_poppler.mk |1 external/poppler/poppler-libjpeg.patch.1| 23 extras/source/autocorr/emoji/emoji.ulf | 24 extras/source/autocorr/lang/bg/DocumentList.xml | 12 extras/source/autocorr/lang/ca/DocumentList.xml | 53 extras/source/autocorr/lang/cs/DocumentList.xml | 24 extras/source/autocorr/lang/da/DocumentList.xml | 24 extras/source/autocorr/lang/en-AU/DocumentList.xml | 24 extras/source/autocorr/lang/en-GB/DocumentList.xml | 24 extras/source/autocorr/lang/en-US/DocumentList.xml | 24 extras/source/autocorr/lang/es/DocumentList.xml | 24 extras/source/autocorr/lang/fi/DocumentList.xml | 24 extras/source/autocorr/lang/fr/DocumentList.xml | 36 extras/source/autocorr/lang/hr/DocumentList.xml | 12 extras/source/autocorr/lang/hu/DocumentList.xml | 24 extras/source/autocorr/lang/is/DocumentList.xml | 13 extras/source/autocorr/lang/it/DocumentList.xml |