Tor Lillqvist
c9796255ae
Don't check for undocumented "eof" frames read from a websocket either
...
Now with "disconnect" frames gone, surely checks for "eof" ones can go
away too, whatever they were.
2016-04-13 15:50:09 +03:00
Pranav Kant
9ea4624839
loolwsd: Handle socket exceptions while trying to send frame
...
In case of abnormal termination of session from client-side,
we might still have data being processed in the kit process, for
example, during auto-save. Trying to send such data over an
expired socket towards the client would throw exceptions which
need to be handled, otherwise the auto-save process would not be
successful. Further, the unhandled exception can bring the document
broker in an unstable state with dockey still present in the
object.
Also do not send 'editlock: 0' to a websocket session which is
going to be removed because the session might have been
forcefully terminated from the client-side, in which case sending
data would go nowhere.
Change-Id: I10eb9c818bc81d4db26d5a19dc8bd44f6fbdf32c
2016-04-13 09:56:32 +05:30
Tor Lillqvist
0f3fa0e9d4
Don't log the payload inside a CLOSE frame
...
It is a status code, a 2-byte unsigned integer in network byte order,
potentially followed by a textual reason. But we never include any
specific status codes in the CLOSE frames anyway. (With a Poco-based
WebSocket peer it is always WS_NORMAL_CLOSE, 1000, 0x03 0xE8.)
2016-04-11 17:21:57 +03:00
Tor Lillqvist
a1f4ded793
YAGNI: Drop parameter with default value that is never overridden
...
No non-default value is never passed. Just use the default value as such in the function.
2016-04-11 11:30:54 +03:00
Tor Lillqvist
077a4436df
Bin unused function PipeReader::process()
2016-04-11 11:21:18 +03:00
Ashod Nakashian
4cab42b20f
loolwsd: logging improvements
...
Change-Id: Idba11b0ae18337d78ea504a455ddc9494cff7ef0
Reviewed-on: https://gerrit.libreoffice.org/23967
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 17:21:32 +00:00
Ashod Nakashian
70e8132866
loolwsd: correct handling socket buffer size and exception handling
...
Change-Id: I3eb28405c8f30a98c1b1e9644e9303d6074337e3
Reviewed-on: https://gerrit.libreoffice.org/23942
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-09 19:56:11 +00:00
Tor Lillqvist
cc166639ef
For more safety (?), catch Poco::Exception in general, not just IOException
...
Also, display more information about the exception.
Actually I think I should factor out the code to display as much
information as possible from an exception. Currently the amount of
information displayed varies from case to case in the code-base.
2016-04-08 14:28:52 +03:00
Tor Lillqvist
557ca90be1
Remove unused IoUtil::readMessage()
2016-04-07 20:18:22 +03:00
Tor Lillqvist
4ed3393f16
Nothing ever passed for the pollTimeoutMs parameter so use the default value in-line
2016-04-07 20:07:56 +03:00
Tor Lillqvist
584a805781
The SocketProcessor() 'name' parameter can now be dropped
2016-04-07 20:07:50 +03:00
Tor Lillqvist
5ea6c4bacf
No need to show the SocketProcessor 'name' in the log
...
The thread name already identifies it sufficiently as can be seen:
kit-05108-00 00:00:01.662974 [loolkit ] [ChildControllerWS] Starting Socket Processor.
wsd-05087-03 00:00:08.126842 [client_ws_0002 ] [Client_ws_0002] Starting Socket Processor.
wsd-05087-05 00:00:08.153688 [prison_ws_0002 ] [Child_ws_0002] Starting Socket Processor.
2016-04-07 19:52:53 +03:00
Tor Lillqvist
5637064e9a
Factor out the prctl() calls
...
Silly to keep copy-pasting the same couple of lines over and over
again.
2016-04-07 11:53:33 +03:00
Tor Lillqvist
ec604599f1
Introduce separate Log::syserror() function for logging actual syscall errors
...
Much better than assuming that errno would be relevant at all
Log::error() calls (or alternatively, having to remember to append a
false parameter to the Log::error() call, which had not been done a
single time anyway.)
Call log::syserror() right after a system call has returned an
error. Don't call it otherwise.
2016-04-07 10:36:38 +03:00
Ashod Nakashian
3499878fae
loolwsd: logging and cleanups
...
Change-Id: I0664be51da54d2e374808256e6598ba025f0324e
Reviewed-on: https://gerrit.libreoffice.org/23822
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-05 02:59:12 +00:00
Tor Lillqvist
321b244eb3
Catch also NetException in SocketProcessor()
...
Doesn't seem to fix anything, but probably is a good idea to not let
such an exception propagate, but treat it as the connection closing.
2016-04-04 15:46:27 +03:00
Ashod Nakashian
fdd3efaad8
loolwsd: reduced some excessive logs to trace level
...
Change-Id: I9ffcdf5c3ad5781db93e0e3dd7aa7b137c77b25a
Reviewed-on: https://gerrit.libreoffice.org/23792
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:09:19 +00:00
Ashod Nakashian
4be24759f3
loolwsd: SocketProcessor takes HTTPResponse and not HTTPServerResponse
...
Change-Id: I8a6e1468bc26b4a81ae13a567fd7331207ac37fc
Reviewed-on: https://gerrit.libreoffice.org/23786
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:06:42 +00:00
Ashod Nakashian
285026b6f6
loolwsd: removed PipeRunnable thread from Broker and merged it with main
...
Change-Id: Ie10f046ed230d891eb0647e409756a34a4b146b8
Reviewed-on: https://gerrit.libreoffice.org/23776
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:03:21 +00:00
Tor Lillqvist
422834ebef
Improve logging
...
Don't embed newlines in "lines" written to the log. When logging stuff
read from or written to the fifos, translate newlines to " / " for
clarity.
(If we would want complete, exact verbose logging, we should be really
pedantic and log all non-printable bytes in hex anyway, etc, so
displaying newlines as space-separated slashes should be OK. It isn't
as if there would be totally arbitary data passed through the fifos
anyway.)
2016-03-31 11:01:52 +03:00
Miklos Vajna
f30e22d0a3
loolwsd: fix -Werror,-Wshadow
2016-03-30 09:39:48 +02:00
Ashod Nakashian
2ba9bddf9a
loolwsd: logging improvements
...
Change-Id: Ie656aa9d9f19762a960f6608cdadccf3c7eee665
Reviewed-on: https://gerrit.libreoffice.org/23646
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 02:03:25 +00:00
Ashod Nakashian
fe69c4d5b6
loolwsd: pipe plumbing cleanup
...
Change-Id: I5519235a4601e1e38cedc3f06ffe9386434a292d
Reviewed-on: https://gerrit.libreoffice.org/23645
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 02:02:53 +00:00
Ashod Nakashian
ecce874315
loolwsd: new PipeReader class to poll and tokenize pipe messages
...
Change-Id: I5676b313ca4c7e711ead04c1491fe36591a00531
Reviewed-on: https://gerrit.libreoffice.org/23644
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:59:31 +00:00
Ashod Nakashian
3d2c2fde3b
loolwsd: logging and misc cleanup
...
Change-Id: If3cea8191fe15fc752c436cd33d2a68dc2d88598
Reviewed-on: https://gerrit.libreoffice.org/23638
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:46:34 +00:00
Ashod Nakashian
b25fe9d88a
loolwsd: moved SocketProcessor to IoUtil and generalized more
...
Change-Id: I527e57d2430e21249cf8cd4867f22fdbbd092b09
Reviewed-on: https://gerrit.libreoffice.org/23637
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:45:20 +00:00
Ashod Nakashian
ce2fabb733
loolwsd: moved IO utilities into IoUtil file
...
Change-Id: I1e8d5562787134cbb490c38b19d83b7514ec9baa
Reviewed-on: https://gerrit.libreoffice.org/23586
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-29 14:09:04 +00:00