[Libreoffice-commits] online.git: Makefile.am test/Makefile.am

2020-07-06 Thread Yunusemre Şentürk (via logerrit)
 Makefile.am  |2 +-
 test/Makefile.am |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 187aefb6269b403b3029907c6b8e6dfb7374e849
Author: Yunusemre Şentürk 
AuthorDate: Mon Jul 6 11:09:54 2020 +0300
Commit: Andras Timar 
CommitDate: Mon Jul 6 10:41:14 2020 +0200

Fix lool user control issue on packaging

Change-Id: I1e75279f955a74da5f167dff4648d142af51ab1b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98192
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/Makefile.am b/Makefile.am
index fbb1edb55..2f6761771 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -322,7 +322,7 @@ EXTRA_DIST = discovery.xml \
  scripts/unocommands.py \
  $(man_MANS)
 
-CLEANUP_COMMAND=if test -s ./loolwsd; then echo "Cleaning up..." && ./loolwsd 
--cleanup --o:logging.level=trace; fi
+CLEANUP_COMMAND=if test -s ./loolwsd; then echo "Cleaning up..." && ./loolwsd 
--disable-lool-user-checking --cleanup --o:logging.level=trace; fi
 
 if HAVE_LO_PATH
 
diff --git a/test/Makefile.am b/test/Makefile.am
index 327832f79..9fa6506b1 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -193,7 +193,7 @@ else
 SYSTEM_STAMP =
 endif
 
-CLEANUP_COMMAND=if test -s ../loolwsd; then echo "Cleaning up..." && 
../loolwsd --cleanup --o:logging.level=trace; fi
+CLEANUP_COMMAND=if test -s ../loolwsd; then echo "Cleaning up..." && 
../loolwsd --disable-lool-user-checking --cleanup --o:logging.level=trace; fi
 
 if HAVE_LO_PATH
 check-local:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Makefile.am test/Makefile.am

2020-07-01 Thread Ashod Nakashian (via logerrit)
 Makefile.am  |   28 +++-
 test/Makefile.am |2 ++
 2 files changed, 17 insertions(+), 13 deletions(-)

New commits:
commit a062581be6b55d9c498c8f1d4e5cec9c4126e234
Author: Ashod Nakashian 
AuthorDate: Wed Jul 1 13:06:46 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Jul 2 02:32:43 2020 +0200

make: improve cleanup dependency graph

Change-Id: I8a7edd3b49a272cb7bd8bff4d91b189a5856c5c8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97647
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 

diff --git a/Makefile.am b/Makefile.am
index 0eba81cf5..074f05376 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -329,14 +329,25 @@ SYSTEM_STAMP = @SYSTEMPLATE_PATH@/system_stamp
 CAPABILITIES = $(if @ENABLE_SETCAP@,true,false)
 RUN_GDB = $(if $(GDB_FRONTEND),$(GDB_FRONTEND),gdb --tui --args)
 
-$(SYSTEM_STAMP) : ${top_srcdir}/loolwsd-systemplate-setup
-   if test -s ./loolwsd; then ./loolwsd --cleanup; fi
+# Add caps to the binaries that need them.
+caps_bins: loolforkit loolmount
+if ENABLE_SETCAP
+   sudo @SETCAP@ cap_fowner,cap_mknod,cap_sys_chroot=ep loolforkit
+   sudo @SETCAP@ cap_sys_admin=ep loolmount
+else
+   echo "Skipping capability setting"
+endif
+
+# Build loolwsd and loolmount first, so we can cleanup before updating
+# the systemplate directory, which we can't rm if it's mounted.
+$(SYSTEM_STAMP): ${top_srcdir}/loolwsd-systemplate-setup loolwsd caps_bins
+   $(CLEANUP_COMMAND)
if test "z@SYSTEMPLATE_PATH@" != "z"; then rm -rf "@SYSTEMPLATE_PATH@"; 
fi
${top_srcdir}/loolwsd-systemplate-setup "@SYSTEMPLATE_PATH@" 
"@LO_PATH@" && touch $@
 
-@JAILS_PATH@ :
-   mkdir -p $@
+@JAILS_PATH@:
$(CLEANUP_COMMAND)
+   mkdir -p $@
 
 clean-local:
$(CLEANUP_COMMAND)
@@ -464,16 +475,7 @@ endif
 # installing the RPM or Debian package.
 .PHONY: caps_bins
 
-caps_bins: loolforkit loolmount
-if ENABLE_SETCAP
-   sudo @SETCAP@ cap_fowner,cap_mknod,cap_sys_chroot=ep loolforkit
-   sudo @SETCAP@ cap_sys_admin=ep loolmount
-else
-   echo "Skipping capability setting"
-endif
-
 all-local: loolwsd caps_bins @JAILS_PATH@ $(SYSTEM_STAMP)
-   $(CLEANUP_COMMAND)
 
 # just run the build without any tests
 build-nocheck: all-am
diff --git a/test/Makefile.am b/test/Makefile.am
index c12038b0d..327832f79 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -309,3 +309,5 @@ all-local: unittest
@echo
@fc-cache "@LO_PATH@"/share/fonts/truetype
@UNITTEST=1 ${top_builddir}/test/unittest
+   echo "Done test all-local"
+   $(CLEANUP_COMMAND)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Makefile.am test/Makefile.am

2017-03-31 Thread Pranav Kant
 Makefile.am  |   15 +++
 test/Makefile.am |2 +-
 2 files changed, 4 insertions(+), 13 deletions(-)

New commits:
commit 453a452ff9d1dcee7e26d0243ddd79dca32c0f13
Author: Pranav Kant 
Date:   Fri Mar 31 14:42:10 2017 +0530

Makefile: Simplify and link zlib properly

Without this, online doesn't link, atleast for me. The problem seems to
be because in presence of target specific _LDFLAGS, AM_LDFLAGS is
ignored and it is only the latter where we are specifying ZLIB_LIBS.

Further, since the LDFLAGS values are same for all targets, we can
simplify here and rather use AM_LDFLAGS and remove all target specific
LDFLAGS.

Change-Id: I2f1c30c7f34b32c638a4ac60fab709b32f1e6c9a
Reviewed-on: https://gerrit.libreoffice.org/35959
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/Makefile.am b/Makefile.am
index 0d9116b5..76f1dc8d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,20 +26,11 @@ AM_CPPFLAGS = -pthread 
-DLOOLWSD_DATADIR='"@LOOLWSD_DATADIR@"' \
  -DLOOLWSD_CONFIGDIR='"@LOOLWSD_CONFIGDIR@"' \
  -DDEBUG_ABSSRCDIR='"@abs_srcdir@"' \
  ${include_paths}
-AM_LDFLAGS = -pthread -Wl,-E $(ZLIB_LIBS)
-loolforkit_LDFLAGS = -pthread -Wl,-E,-rpath,/snap/loolwsd/current/usr/lib
-loolforkit_nocaps_LDFLAGS = -pthread 
-Wl,-E,-rpath,/snap/loolwsd/current/usr/lib
-loolmount_LDFLAGS = -pthread -Wl,-E,-rpath,/snap/loolwsd/current/usr/lib
-loolnb_LDFLAGS = -pthread -Wl,-E,-rpath,/snap/loolwsd/current/usr/lib
-loolwsd_LDFLAGS = -pthread -Wl,-E,-rpath,/snap/loolwsd/current/usr/lib
-loolwsd_fuzzer_LDFLAGS = -pthread -Wl,-E,-rpath,/snap/loolwsd/current/usr/lib
+
+AM_LDFLAGS = -pthread -Wl,-E,-rpath,/snap/loolwsd/current/usr/lib $(ZLIB_LIBS)
 
 if ENABLE_SSL
-loolforkit_LDFLAGS += -lssl -lcrypto
-loolforkit_nocaps_LDFLAGS += -lssl -lcrypto
-loolnb_LDFLAGS += -lssl -lcrypto
-loolwsd_LDFLAGS += -lssl -lcrypto
-loolwsd_fuzzer_LDFLAGS += -lssl -lcrypto
+AM_LDFLAGS += -lssl -lcrypto
 endif
 
 loolwsd_fuzzer_CPPFLAGS = -DKIT_IN_PROCESS=1 -DFUZZER=1 
-DTDOC=\"$(abs_top_srcdir)/test/data\" $(AM_CPPFLAGS)
diff --git a/test/Makefile.am b/test/Makefile.am
index 9008efa1..6be2a535 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -20,7 +20,7 @@ noinst_LTLIBRARIES = \
unit-minsocketbuffersize.la
 
 MAGIC_TO_FORCE_SHLIB_CREATION = -rpath /dummy
-AM_LDFLAGS = -pthread -module $(MAGIC_TO_FORCE_SHLIB_CREATION)
+AM_LDFLAGS = -pthread -module $(MAGIC_TO_FORCE_SHLIB_CREATION) $(ZLIB_LIBS)
 
 # We work around some of the mess of using the same sources both on
 # the server side and here in unit tests with conditional compilation
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Makefile.am test/Makefile.am wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/PrisonerSession.cpp wsd/SenderQueue.hpp wsd/TileCache.cpp

2016-12-13 Thread Ashod Nakashian
 Makefile.am |1 -
 test/Makefile.am|1 -
 wsd/ClientSession.cpp   |   44 +++-
 wsd/ClientSession.hpp   |   39 +++
 wsd/DocumentBroker.cpp  |   15 +--
 wsd/PrisonerSession.cpp |2 +-
 wsd/SenderQueue.hpp |   48 
 wsd/TileCache.cpp   |   12 ++--
 8 files changed, 122 insertions(+), 40 deletions(-)

New commits:
commit fe38e0e1e67c64bc7d91a5ac20c5bf05d4282928
Author: Ashod Nakashian 
Date:   Tue Dec 13 19:20:05 2016 -0500

loolwsd: per-socket dedicated sending thread

To avoid degrading performance for everyone
because of a single slow/bad connection, we
send data to clients each in its own thread.

Change-Id: I6f980c25a404c4d05bcdb1979849ea3d2776c7b9
Reviewed-on: https://gerrit.libreoffice.org/31984
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/Makefile.am b/Makefile.am
index b1f1932..79120bc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -53,7 +53,6 @@ loolwsd_SOURCES = wsd/Admin.cpp \
   wsd/ClientSession.cpp \
   wsd/FileServer.cpp \
   wsd/PrisonerSession.cpp \
-  wsd/SenderQueue.cpp \
   wsd/Storage.cpp \
   wsd/TileCache.cpp \
   $(shared_sources)
diff --git a/test/Makefile.am b/test/Makefile.am
index 9a6d715..992830e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -37,7 +37,6 @@ wsd_sources = \
 ../common/Session.cpp \
 ../common/MessageQueue.cpp \
 ../kit/Kit.cpp \
-../wsd/SenderQueue.cpp \
 ../wsd/TileCache.cpp \
 ../common/Unit.cpp \
 ../common/Util.cpp
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index f1188b5..c97ef64 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -44,9 +44,12 @@ ClientSession::ClientSession(const std::string& id,
 _uriPublic(uriPublic),
 _isReadOnly(readOnly),
 _isDocumentOwner(false),
-_loadPart(-1)
+_loadPart(-1),
+_stop(false)
 {
 Log::info("ClientSession ctor [" + getName() + "].");
+
+_senderThread = std::thread([this]{ senderThread(); });
 }
 
 ClientSession::~ClientSession()
@@ -55,6 +58,13 @@ ClientSession::~ClientSession()
 
 // Release the save-as queue.
 _saveAsQueue.put("");
+
+stop();
+if (_senderThread.joinable())
+{
+_senderThread.join();
+}
+
 }
 
 void ClientSession::bridgePrisonerSession()
@@ -453,4 +463,36 @@ void ClientSession::setReadOnly()
 sendTextFrame("perm: readonly");
 }
 
+void ClientSession::senderThread()
+{
+LOG_DBG(getName() + " SenderThread started");
+
+while (!stopping())
+{
+std::shared_ptr item;
+if (_senderQueue.waitDequeue(item, 
static_cast(POLL_TIMEOUT_MS)))
+{
+const std::vector& data = item->data();
+try
+{
+if (item->isBinary())
+{
+Session::sendBinaryFrame(data.data(), data.size());
+}
+else
+{
+Session::sendTextFrame(data.data(), data.size());
+}
+}
+catch (const std::exception& ex)
+{
+LOG_ERR("Failed to send message [" << 
LOOLProtocol::getAbbreviatedMessage(data) <<
+"] to " << getName() << ": " << ex.what());
+}
+}
+}
+
+LOG_DBG(getName() + " SenderThread finished");
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index a96d807..f6bc8a5 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -13,6 +13,7 @@
 #include "Session.hpp"
 #include "Storage.hpp"
 #include "MessageQueue.hpp"
+#include "SenderQueue.hpp"
 
 #include 
 
@@ -44,6 +45,38 @@ public:
 void setDocumentOwner(const bool documentOwner) { _isDocumentOwner = 
documentOwner; }
 bool isDocumentOwner() const { return _isDocumentOwner; }
 
+using Session::sendTextFrame;
+
+bool sendBinaryFrame(const char* buffer, int length) override
+{
+auto payload = std::make_shared(length, 
MessagePayload::Type::Binary);
+auto& output = payload->data();
+std::memcpy(output.data(), buffer, length);
+enqueueSendMessage(payload);
+return true;
+}
+
+bool sendTextFrame(const char* buffer, const int length) override
+{
+auto payload = std::make_shared(length, 
MessagePayload::Type::Text);
+auto& output = payload->data();
+std::memcpy(output.data(), buffer, length);
+enqueueSendMessage(payload);
+return true;
+}
+
+void enqueueSendMessage(const std::shared_ptr& data)
+{