Commit graph

13 commits

Author SHA1 Message Date
Pranav Kant
8d3c60c9a8 Bin 'setting minimum socket buffer' in non-debug mode for tests
Initial effort was setting it when we are compiling with
--enable-debug or when not, unit tests are running, but since we don't
run the unit tests in absence of --enable-debug anyways,
there is no use for this #else code block.

Change-Id: I9d7c66a18be160a47afd2bf336d89d50d4f2463e
2016-12-18 00:34:43 +05:30
Pranav Kant
b26969b98c wsd: set minimum socket buffer size in debug mode
Change-Id: Ieae9721d45ade34c5ce9773867ab1ab997a344dc
Reviewed-on: https://gerrit.libreoffice.org/32071
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-12-16 10:24:14 +00:00
Pranav Kant
9b37eed727 Add missing config.h
Change-Id: Ib63c0bdfc8126fea211c5311c957985de6b00129
2016-12-16 11:33:18 +05:30
Michael Meeks
e24dfb9616 Use a blocking write rather than failing when no space in write buffer.
Also avoid a poll syscall for an error state we'll get from the write.
2016-12-15 13:51:07 +00:00
Ashod Nakashian
875d11f88b loolwsd: simplify checking for closed socket
Change-Id: I1f41c40bdd42ad6ab9224a2b13af97f84175492c
Reviewed-on: https://gerrit.libreoffice.org/31983
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-14 04:14:57 +00:00
Ashod Nakashian
aa1d721444 loolwsd: harden against socket errors and lock while receiving
Change-Id: I402d387272e0e30d2fe035842c50f40c3806e20d
Reviewed-on: https://gerrit.libreoffice.org/31933
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-13 04:36:27 +00:00
Tor Lillqvist
7263491ea6 Document return value of our LOOLWebSocket::receiveFrame()
Especially the -1 return value, which is different from what
the Poco WebSocket::receiveFrame() can return.
2016-12-02 16:52:48 +02:00
Tor Lillqvist
f144dd9f05 Log also the frame as received 2016-12-02 16:52:48 +02:00
Tor Lillqvist
ffbc9baccc Use getAbbreviatedFrameDump() instead of getAbbreviatedMessage() when logging
The more information the better, when tracking problems.
2016-12-02 16:52:48 +02:00
Jan Holesovsky
9842f3239f Make sure we don't use the jitter / delay in production builds.
And default to 0 even for debug; who wants to use that for debugging, they
know what to do.

Change-Id: I23dd0c5f806b2b31a883b7a2b8d822ea8c0bb6c5
2016-11-28 11:31:06 +01:00
Ashod Nakashian
6ab32e0aa9 loolwsd: use larger threshold to large messages
Messages larger than a certain size are preambled
with a 'nextmessage' message that hold the size
of the subsequent message.

This is a workaround to a limitation the Poco
WebSocket API where if the buffer size is
smaller than the received frame the socket
ends up in a bad state and must be closed.
Unfortunately the new API that avoids this
workaround is not yet released by Poco.

Here we minimize the need for 'nextmessage'
to truely large messages. The limit is now
raised from above 1KB to over 63KB.

We may raise this limit further, but that will
cost each socket that much dedicated buffer size.

Change-Id: I01e4c68cdbe67e413c04a9725152224a87ab8267
Reviewed-on: https://gerrit.libreoffice.org/31286
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:54:37 +00:00
Michael Meeks
c1a398977f Adapt makefiles, includes etc. to new locations. 2016-11-25 09:58:57 +00:00
Michael Meeks
cca657c8f2 Apply the pre-branch rename script to re-organize the source. 2016-11-25 09:58:48 +00:00
Renamed from loolwsd/LOOLWebSocket.hpp (Browse further)