Michael Meeks
5763d8d9bb
Improve debugging.
2017-03-10 23:28:34 +00:00
Michael Meeks
a9d5801c37
Unwind releaseSocket complexity.
...
We only move sockets in response to input on the socket, which
must happen in the thread that we're processing that input on.
Ergo - no need for this complexity.
2017-03-10 18:46:31 +00:00
Michael Meeks
027b8110ed
Allow isCorrectThread asserts to be hard, or off by default.
2017-03-10 18:46:16 +00:00
Michael Meeks
c30fb670d8
Work on LOOL_CHECK_THREADS=1 a little.
...
The situation made more problematic since the std::thread is only
created in startThread - so getting ownership right before then in
Socket is problematic.
2017-03-10 18:20:51 +00:00
Michael Meeks
160446fd23
Work on resurrecting dying DocumentBrokers if we can.
...
The hope is that they will close lingering session sockets at the
end and the client will re-connect.
2017-03-10 17:58:51 +00:00
Michael Meeks
1065441e7c
Don't autosave if we're being stopped and happened to be overdue.
2017-03-10 16:42:59 +00:00
Michael Meeks
173ca5e3d6
Quote ETag.
2017-03-10 16:42:48 +00:00
Michael Meeks
7a90430f85
Cleanup logging on single packet websocket messages more cleanly.
2017-03-10 14:49:19 +00:00
Michael Meeks
11f3a29cb2
WebSocket - several messages can appear in a single packet.
2017-03-10 14:36:21 +00:00
Michael Meeks
34d9d52207
Avoid assert failure and zero size socket buffer in product build.
2017-03-10 12:12:10 +00:00
Michael Meeks
f4f083e6fe
Cache JS etc. on the client side for 128 days.
2017-03-10 11:36:10 +00:00
Michael Meeks
a5a227e9a3
Re-work socket buffer options, sizing and setting.
...
Only set nodelay and small socket buffers on WebSockets.
Avoid writing more data than can be absorbed by our socket buffer.
It is fine to set socket buffer sizes after bind/accept.
2017-03-10 10:55:29 +00:00
Miklos Vajna
2f07eb9a7d
Fix remaining -Werror,-Winconsistent-missing-override warnings
...
The last ones introduced by the non-blocking merge.
Change-Id: I0b9264428669cdd2b8f6eac911c336c6b0e8de99
2017-03-10 11:11:58 +01:00
Miklos Vajna
400c580800
net: fix -Werror,-Wconstant-conversion
...
Change-Id: If2bbad6d3909c7d6df9eed5edf260609d64db3a8
2017-03-10 11:06:43 +01:00
Miklos Vajna
33cbe908c5
net: fix -Werror,-Winconsistent-missing-override
...
Change-Id: Ia8c1f0233e0b65f5fae01272b4f31638aceac9ee
2017-03-10 10:54:08 +01:00
Ashod Nakashian
2d621f1a47
nb: logging
...
Change-Id: Ic3b724d5869f75234af2238b96a90c4745155b86
2017-03-10 10:47:44 +01:00
Ashod Nakashian
1da9bc3d69
nb: set the polling thread name for better logging
...
Change-Id: Iccc4337827f00af08327a4430f3d40fa69ac71b2
2017-03-10 10:47:44 +01:00
Michael Meeks
3bfc8aa7f3
Use larger socket buffers for serving files to improve efficiency.
...
The combination of nodelay + minimum buffers is horrific for
file-serving; speedup is from 3.3s to 33ms to serve bundle.js.
2017-03-10 10:47:44 +01:00
Michael Meeks
42a19e66e3
Centralize idle poll time.
2017-03-10 10:47:44 +01:00
Michael Meeks
438630c68f
Start DocBroker thread later - when we've added our 1st session.
2017-03-10 10:47:44 +01:00
Michael Meeks
e16fc97c15
SocketPoll - better control starting our threads.
...
Extraordinary trace with a thread starting before the SocketPoll's
derived classes had started - ie. with wrong vtables etc.
2017-03-10 10:47:44 +01:00
Michael Meeks
842b261d9f
Move auto-save of document into the DocumentBroker poll more convincingly.
2017-03-10 10:47:44 +01:00
Jan Holesovsky
4eccd4d7b4
nb: Check threads only when LOOL_CHECK_THREADS is set.
...
Change-Id: I4137685eb956469d419bded318b83de2b10ce19d
2017-03-10 10:47:44 +01:00
Jan Holesovsky
b895393cea
nb: Perform the socket shutdown asynchronously after the data is served.
...
Change-Id: I642e26abf4ef9c8d2be1be428b5786692dfea2c7
2017-03-10 10:47:44 +01:00
Ashod Nakashian
b8af470918
nb: serve files synchronously
...
As there isn't support (yet) to send files
asynchronously, when the socket native buffer
is small, asynchronous writes naturally return
EWOULDBLOCK. As a temp solution, we send files
synchronously, so there is no need to poll.
This should be replaced witha file-server
polling/serving thread that is dedicated to
sending files only (which closes the connection
when done).
Change-Id: I062fea44bfe54ab8d147b745da97bd499bf00657
2017-03-10 10:47:44 +01:00
Michael Meeks
37de43bb58
Tie sockets to threads, and assert that we're being used in the right one.
...
This shows up some problems around cleaning up prisoners etc. that will
need fixing subsequently.
2017-03-10 10:47:43 +01:00
Michael Meeks
0eaef6c896
config.h - get includes right: must always be the first include.
2017-03-10 10:47:43 +01:00
Ashod Nakashian
7b1ed1b4d4
nb: more informative logging of socket activity
...
Change-Id: I9036c778c195936678c6451ba57cc794d6ba0006
2017-03-10 10:47:43 +01:00
Ashod Nakashian
221bfdefc8
nb: get the poll sockets size after setting up
...
Change-Id: I35174f2f9345286791ccefe2d6dc521a767b6571
2017-03-10 10:47:43 +01:00
Ashod Nakashian
aee954af8b
nb: include the SocketPoll name in logs
...
Change-Id: I7a93edfe0bc74e62bd2726f6fa8425c719326023
2017-03-10 10:47:43 +01:00
Michael Meeks
ce4bd9b9be
Unify DocumentBroker thread and its SocketPoll.
2017-03-10 10:47:43 +01:00
Michael Meeks
79fb1e2c1f
Sub-class the SocketPoll to allow more flexibility in termination.
2017-03-10 10:47:43 +01:00
Ashod Nakashian
c6dbce9767
nb: transfer client sockets to respective DocumentBroker
...
Change-Id: I6af656ec6cbb09d4dd80b7b583a009a763de6eb9
2017-03-10 10:47:43 +01:00
Ashod Nakashian
76e96c92c8
nb: SocketPoll is now a thread object
...
Change-Id: I01d13292f0b97a9ebd1ccdef9e41fec46bfa0b11
2017-03-10 10:47:43 +01:00
Michael Meeks
20f15d4001
Switch Prisoner socket handling to use the SocketPoll.
...
Kills the Poco ThreadPool usage, and significantly improves debuggability.
2017-03-10 10:47:43 +01:00
Michael Meeks
a856a95138
Dump buffer contents as hex if we have them.
2017-03-10 10:47:42 +01:00
Michael Meeks
d4cc2e899c
ClientSession: kill the writing thread.
2017-03-10 10:47:42 +01:00
Michael Meeks
6711701721
Socket API to allow asynchronous writing.
2017-03-10 10:47:42 +01:00
Michael Meeks
1655e5d062
Improve socket state dumping on USR1.
2017-03-10 10:47:42 +01:00
Ashod Nakashian
d68377748d
nb: ReadOrWrite -> Neither
...
SSL only requests what to poll for next.
So it's more accurate to rename ReadOrWrite
to Neither, since in that case SSL really
isn't blocked on either read or write.
Change-Id: I62dd4f94730d51666a7661b10a9d582d69fbf45e
2017-03-10 10:47:42 +01:00
Ashod Nakashian
9c0d8cc5b2
nb: log more socket activity
...
Change-Id: Ibcdf5abc3054691c93382c00bb8a9ecc4b882652
2017-03-10 10:47:42 +01:00
Michael Meeks
fa96673ee0
Connect USR1 to initial global state dumping goodness.
2017-03-10 10:47:42 +01:00
Michael Meeks
fffd970425
Work around global initialization order issue with global wakeups.
2017-03-10 10:47:42 +01:00
Michael Meeks
fa6b756346
signal handling: keep track of all socket poll wakeups & wakeup.
...
Instead of waiting for polls to timeout; wake them up.
2017-03-10 10:47:42 +01:00
Jan Holesovsky
17d8b645b4
nb: It seems uppercase 'S' is preferred in Sec-WebSocket-Accept.
...
Change-Id: I6cc86f26cf7e3c9370e5d534877bfeeb6607f5a4
2017-03-10 10:47:42 +01:00
Jan Holesovsky
62afe66df0
nb: Make the loolnb / clientnb work again.
...
The more testing the better :-)
Change-Id: Ibe4249f18109d50b06e1fa35e6d0fef67f9b3643
2017-03-10 10:47:42 +01:00
Ashod Nakashian
8040dc0746
nb: disable hex dumping
...
No longer necessary to have them enabled
permanently, especially that they affect
performance significantly negatively.
Change-Id: I02ef99da00ba4ecb8e24647ee372a03d79d07fe7
2017-03-10 10:47:42 +01:00
Jan Holesovsky
653df9dcce
nb: No need for the WebSocketSender I think.
...
Change-Id: I133bb8341a846d70f95e0c70274541b5db62f65d
2017-03-10 10:47:42 +01:00
Jan Holesovsky
759895a8d7
nb: This file is not needed any more.
...
Change-Id: Ic73ddcc61495889fd36eb6f23f41c1bd45eb85c6
2017-03-10 10:47:42 +01:00
Jan Holesovsky
be743c115d
nb: When we cannot send the file, we must respond with 404.
...
Change-Id: I5f11e7de4b0bfb6e44929b8317e4788d2cc81610
2017-03-10 10:47:41 +01:00