[Libreoffice-commits] online.git: Branch 'private/hcvcastro/forking' - loolwsd/ChildProcessSession.cpp

2015-07-23 Thread Henry Castro
 loolwsd/ChildProcessSession.cpp |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 744f7ff395d608dec650db6f7dfbe3e7d499183c
Author: Henry Castro hcas...@collabora.com
Date:   Thu Jul 23 16:19:14 2015 -0400

loolwsd: remove Application logger.

diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index 49e6a43..1b841f9 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -30,7 +30,6 @@
 
 #include Poco/Net/WebSocket.h
 #include Poco/StringTokenizer.h
-#include Poco/Util/Application.h
 #include Poco/URI.h
 #include Poco/Path.h
 
@@ -42,7 +41,6 @@
 using namespace LOOLProtocol;
 using Poco::Net::WebSocket;
 using Poco::StringTokenizer;
-using Poco::Util::Application;
 using Poco::URI;
 using Poco::Path;
 
@@ -107,7 +105,7 @@ bool ChildProcessSession::handleInput(const char *buffer, 
int length)
 std::string firstLine = getFirstLine(buffer, length);
 StringTokenizer tokens(firstLine,  , StringTokenizer::TOK_IGNORE_EMPTY | 
StringTokenizer::TOK_TRIM);
 
-Application::instance().logger().information(Util::logPrefix() + 
_kindString + ,Input, + getAbbreviatedMessage(buffer, length));
+std::cout  Util::logPrefix() + _kindString + ,Input, + 
getAbbreviatedMessage(buffer, length)  std::endl;
 
 if (tokens[0] == load)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'private/hcvcastro/forking' - loolwsd/ChildProcessSession.cpp loolwsd/ChildProcessSession.hpp loolwsd/LOOLBroker.cpp loolwsd/LOOLKit.cpp loolwsd/LOOLSession.cp

2015-07-23 Thread Henry Castro
 loolwsd/ChildProcessSession.cpp   |  560 +
 loolwsd/ChildProcessSession.hpp   |   57 ++
 loolwsd/LOOLBroker.cpp|  451 +
 loolwsd/LOOLKit.cpp   |  164 ++
 loolwsd/LOOLSession.cpp   |  975 --
 loolwsd/LOOLSession.hpp   |  102 ---
 loolwsd/LOOLWSD.cpp   |  613 +++
 loolwsd/LOOLWSD.hpp   |9 
 loolwsd/Makefile.am   |   21 
 loolwsd/MasterProcessSession.cpp  |  571 ++
 loolwsd/MasterProcessSession.hpp  |   73 ++
 loolwsd/loolwsd-systemplate-setup |   42 +
 12 files changed, 2030 insertions(+), 1608 deletions(-)

New commits:
commit b9a04ecac1f618e770cab227db2996ad5e1135a6
Author: Henry Castro hcas...@collabora.com
Date:   Thu Jul 23 09:23:24 2015 -0400

loolwsd: Initial setup

Separate classes, MasterProcessSession, ChildProcessSession
config loolwsd-systemplate-setup, adjust code, create
process LOOBroker and LOOLKit

diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
new file mode 100644
index 000..49e6a43
--- /dev/null
+++ b/loolwsd/ChildProcessSession.cpp
@@ -0,0 +1,560 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include sys/stat.h
+#include sys/types.h
+
+#include ftw.h
+#include utime.h
+
+#include cassert
+#include condition_variable
+#include cstring
+#include fstream
+#include iostream
+#include iterator
+#include map
+#include memory
+#include mutex
+#include set
+
+/*#define LOK_USE_UNSTABLE_API
+#include LibreOfficeKit/LibreOfficeKit.h
+#include LibreOfficeKit/LibreOfficeKitEnums.h*/
+
+#include Poco/Net/WebSocket.h
+#include Poco/StringTokenizer.h
+#include Poco/Util/Application.h
+#include Poco/URI.h
+#include Poco/Path.h
+
+#include ChildProcessSession.hpp
+#include Util.hpp
+#include LOOLProtocol.hpp
+#include LOKitHelper.hpp
+
+using namespace LOOLProtocol;
+using Poco::Net::WebSocket;
+using Poco::StringTokenizer;
+using Poco::Util::Application;
+using Poco::URI;
+using Poco::Path;
+
+/*
+
+#include Poco/Exception.h
+#include Poco/File.h
+#include Poco/Net/HTTPStreamFactory.h
+#include Poco/Process.h
+#include Poco/Random.h
+#include Poco/StreamCopier.h
+#include Poco/String.h
+#include Poco/ThreadLocal.h
+#include Poco/URIStreamOpener.h
+#include Poco/Exception.h
+#include Poco/Net/NetException.h
+#include Poco/Net/DialogSocket.h
+#include Poco/Net/SocketAddress.h
+
+#include LOOLSession.hpp
+#include LOOLWSD.hpp
+#include TileCache.hpp
+
+
+using Poco::File;
+using Poco::IOException;
+using Poco::Net::HTTPStreamFactory;
+using Poco::Process;
+using Poco::ProcessHandle;
+using Poco::Random;
+using Poco::StreamCopier;
+using Poco::Thread;
+using Poco::ThreadLocal;
+using Poco::UInt64;
+using Poco::URIStreamOpener;
+using Poco::Util::Application;
+using Poco::Exception;
+using Poco::Net::DialogSocket;
+using Poco::Net::SocketAddress;
+using Poco::Net::WebSocketException;*/
+
+
+ChildProcessSession::ChildProcessSession(std::shared_ptrWebSocket ws, 
LibreOfficeKit *loKit) :
+LOOLSession(ws, Kind::ToMaster),
+_loKitDocument(NULL),
+_loKit(loKit),
+_clientPart(0)
+{
+std::cout  Util::logPrefix()  ChildProcessSession ctor this=  this 
  ws=  _ws.get()  std::endl;
+}
+
+ChildProcessSession::~ChildProcessSession()
+{
+std::cout  Util::logPrefix()  ChildProcessSession dtor this=  this 
 std::endl;
+if (LIBREOFFICEKIT_HAS(_loKit, registerCallback))
+_loKit-pClass-registerCallback(_loKit, 0, 0);
+Util::shutdownWebSocket(*_ws);
+}
+
+bool ChildProcessSession::handleInput(const char *buffer, int length)
+{
+std::string firstLine = getFirstLine(buffer, length);
+StringTokenizer tokens(firstLine,  , StringTokenizer::TOK_IGNORE_EMPTY | 
StringTokenizer::TOK_TRIM);
+
+Application::instance().logger().information(Util::logPrefix() + 
_kindString + ,Input, + getAbbreviatedMessage(buffer, length));
+
+if (tokens[0] == load)
+{
+if (_docURL != )
+{
+sendTextFrame(error: cmd=load kind=docalreadyloaded);
+return false;
+}
+return loadDocument(buffer, length, tokens);
+}
+else if (_docURL == )
+{
+sendTextFrame(error: cmd= + tokens[0] +  kind=nodocloaded);
+return false;
+}
+else if (tokens[0] == setclientpart)
+{
+return setClientPart(buffer, length, tokens);
+}
+else if (tokens[0] == status)
+{
+return getStatus(buffer, length);
+}
+else if (tokens[0] == tile)
+{
+sendTile(buffer, length, tokens);
+}
+else
+{
+// All other 

[Libreoffice-commits] online.git: Branch 'private/hcvcastro/forking' - loolwsd/ChildProcessSession.cpp loolwsd/LOOLSession.cpp loolwsd/LOOLWSD.cpp

2015-07-23 Thread Henry Castro
 loolwsd/ChildProcessSession.cpp |   43 
 loolwsd/LOOLSession.cpp |4 +--
 loolwsd/LOOLWSD.cpp |3 --
 3 files changed, 2 insertions(+), 48 deletions(-)

New commits:
commit a44c6924e86d92987ea8efea9d470bee5b4c208e
Author: Henry Castro hcas...@collabora.com
Date:   Thu Jul 23 16:49:45 2015 -0400

loolwsd: clean code.

diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index 1b841f9..842b984 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -24,10 +24,6 @@
 #include mutex
 #include set
 
-/*#define LOK_USE_UNSTABLE_API
-#include LibreOfficeKit/LibreOfficeKit.h
-#include LibreOfficeKit/LibreOfficeKitEnums.h*/
-
 #include Poco/Net/WebSocket.h
 #include Poco/StringTokenizer.h
 #include Poco/URI.h
@@ -44,45 +40,6 @@ using Poco::StringTokenizer;
 using Poco::URI;
 using Poco::Path;
 
-/*
-
-#include Poco/Exception.h
-#include Poco/File.h
-#include Poco/Net/HTTPStreamFactory.h
-#include Poco/Process.h
-#include Poco/Random.h
-#include Poco/StreamCopier.h
-#include Poco/String.h
-#include Poco/ThreadLocal.h
-#include Poco/URIStreamOpener.h
-#include Poco/Exception.h
-#include Poco/Net/NetException.h
-#include Poco/Net/DialogSocket.h
-#include Poco/Net/SocketAddress.h
-
-#include LOOLSession.hpp
-#include LOOLWSD.hpp
-#include TileCache.hpp
-
-
-using Poco::File;
-using Poco::IOException;
-using Poco::Net::HTTPStreamFactory;
-using Poco::Process;
-using Poco::ProcessHandle;
-using Poco::Random;
-using Poco::StreamCopier;
-using Poco::Thread;
-using Poco::ThreadLocal;
-using Poco::UInt64;
-using Poco::URIStreamOpener;
-using Poco::Util::Application;
-using Poco::Exception;
-using Poco::Net::DialogSocket;
-using Poco::Net::SocketAddress;
-using Poco::Net::WebSocketException;*/
-
-
 ChildProcessSession::ChildProcessSession(std::shared_ptrWebSocket ws, 
LibreOfficeKit *loKit) :
 LOOLSession(ws, Kind::ToMaster),
 _loKitDocument(NULL),
diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp
index b0a7a05..4b7342a 100644
--- a/loolwsd/LOOLSession.cpp
+++ b/loolwsd/LOOLSession.cpp
@@ -36,7 +36,7 @@ LOOLSession::LOOLSession(std::shared_ptrWebSocket ws, Kind 
kind) :
 _ws(ws),
 _docURL()
 {
-//std::cout  Util::logPrefix()  LOOLSession ctor this=  this   
  _kind   ws=  _ws.get()  std::endl;
+std::cout  Util::logPrefix()  LOOLSession ctor this=  this
 _kind   ws=  _ws.get()  std::endl;
 if (kind == Kind::ToClient) {
 _kindString = ToClient;
 }
@@ -50,7 +50,7 @@ LOOLSession::LOOLSession(std::shared_ptrWebSocket ws, Kind 
kind) :
 
 LOOLSession::~LOOLSession()
 {
-//std::cout  Util::logPrefix()  LOOLSession dtor this=  this   
  _kind  std::endl;
+std::cout  Util::logPrefix()  LOOLSession dtor this=  this
 _kind  std::endl;
 Util::shutdownWebSocket(*_ws);
 }
 
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index ee36e0b..ed9f6cc 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -560,9 +560,6 @@ int LOOLWSD::createBroker()
 {
 Process::Args args;
 
-//args.push_back(--child= + std::to_string(_childId));
-//args.push_back(--port= + std::to_string(LOOLWSD::portNumber));
-//args.push_back(--jail= + LOOLWSD::jail);
 args.push_back(--losubpath= + LOOLWSD::loSubPath);
 args.push_back(--systemplate= + sysTemplate);
 args.push_back(--lotemplate= + loTemplate);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits