Commit Graph

64 Commits

Author SHA1 Message Date
meejah
01510de60e register producers/consumers for TCP and WebSocket 2022-09-27 23:20:11 -06:00
meejah
0ce08b66cf defensive if's -> assert 2021-04-18 21:25:25 -06:00
meejah
aa58b85ace honour log_requests as original code did 2021-04-15 12:28:23 -06:00
meejah
1a1947d7e9 irrelevant 2021-04-15 12:19:40 -06:00
meejah
7a5b7487ef Merge branch 'master' into websocket-support-on-iosim-tests-master 2021-04-15 12:19:16 -06:00
meejah
a2866c55c9 remove 'from __future__' imports 2021-04-15 07:40:15 -06:00
meejah
6698cf95d5 irrelevant (there was only a debug message logged) 2021-04-14 16:54:41 -06:00
meejah
7b92c3701e leave state-machine tracing code (but commented) 2021-04-14 16:33:21 -06:00
meejah
e34cf94271 no need to check anymore 2021-04-14 16:23:49 -06:00
meejah
8aeea711eb cleanup 2021-04-14 15:05:44 -06:00
meejah
a057da49cf disconnect_redundant is redundant 2021-04-14 15:05:44 -06:00
meejah
e689bfcf4f remove debug, doesn't make sense anymore 2021-04-14 15:05:44 -06:00
meejah
941e4fe18a clean up imports 2021-04-14 15:05:44 -06:00
meejah
09e46d3713 cleanup 2021-04-14 15:05:44 -06:00
meejah
9b4e9577b3 whitespace 2021-04-14 15:05:44 -06:00
meejah
27d7ea85e8 error-handling 2021-04-14 15:05:44 -06:00
meejah
b095b6919a cleanup 2021-04-14 15:05:44 -06:00
meejah
40e14174e7 don't need 'binary' subprotocol stuff 2021-04-14 15:05:44 -06:00
meejah
0aaf00f803 get rid of prints 2021-04-14 15:05:44 -06:00
meejah
f18edc89f9 refine 2021-04-14 15:05:44 -06:00
meejah
99c71112b6 a passing thing 2021-04-14 15:05:44 -06:00
meejah
dd1cc7d520 upgrade all tests; reactor_turn(); remove debug 2021-04-14 15:05:44 -06:00
meejah
002773d79f WIP: first passing IOPump test 2021-04-14 15:05:44 -06:00
meejah
5210566150 websocket version of tests, with handshake 2021-04-14 15:05:44 -06:00
meejah
1a461aa461 haxxor 2021-04-14 15:05:44 -06:00
meejah
34d039c38c hack in prelim websocket support 2021-04-14 15:05:44 -06:00
meejah
c2147ee985 change from review: inline _got_handshake 2021-04-14 15:05:44 -06:00
meejah
c8fbc22120 dead code 2021-04-14 15:05:44 -06:00
meejah
b192b5ca71 dead code, correct input 2021-04-14 15:05:44 -06:00
meejah
c09f15d866 re-instate log message 2021-04-14 15:05:44 -06:00
meejah
b03801d155 guard 2021-04-14 15:05:44 -06:00
meejah
942f204140 log again 2021-04-14 15:05:44 -06:00
meejah
ca55509763 fix global stats-gathering / recording 2021-04-14 15:05:44 -06:00
meejah
60e70bac3c cleanup / dead code 2021-04-14 15:05:44 -06:00
meejah
215a0f350b restore 2 missing log-lines 2021-04-14 15:05:44 -06:00
meejah
3ae3bb7443 cleanup, remove dead code 2021-04-14 15:05:44 -06:00
meejah
b7bcdfdca3 more stats / recording works 2021-04-14 15:05:44 -06:00
meejah
ff578fccf8 fix more tests (that examine internals) 2021-04-14 15:05:44 -06:00
meejah
b51237d958 start of refactoring usage-recording: pass one test 2021-04-14 15:05:44 -06:00
meejah
0e64707459 count totals in state-machine 2021-04-14 15:05:44 -06:00
meejah
0e11f1b8f1 (wip) refactor to use Automat state-machine 2021-04-14 15:05:44 -06:00
meejah
fc3507c1f6 flip around 'if' logic to simplify 2021-04-02 23:36:33 -06:00
Joe Harrison
45824ca5d6 Use StringTransportWithDisconnection for transit server tests.
Replace the use of TCP in the test suite with Twisted's
StringTransport, specifically StringTransportWithDisconnection which
allows us to trigger a disconnect event on the server side during testing.

The `dataReceived` method on the server is now called directly, and any
effects will be realised immediately.
Responses are available to the test client using the `value()` method of
the transport objects, and the buffer can be cleared using `clear()`.

This allows all asynchronous behaviour to be removed from the transit
server test suite.
Furthermore, as we never have to wait for the server, tests no longer
hang if they fail: the errors are encountered immediately.
2020-05-23 17:18:47 -07:00
Brian Warner
ac7415a4d0 Merge branch 'pr13' 2020-05-21 23:08:06 -07:00
Brian Warner
1a7faf0654 tolerate clients who disconnect before sending a complete handshake
If the client connected and then immediately disconnected, or disconnected
before sending enough of a handshake to be classified as good or bad, we
tried to record the usage record as if the connection was complete ("happy"),
which triggered an assertion. This dumps an error to the log and failed to
record the usage record. In May 2020, this happened 55 times in 40 days.
2020-05-21 22:49:14 -07:00
Brian Warner
1242f36624 tolerate data arriving briefly after we hang up
If the file receiver hangs up on an established connection, we do a
`transport.loseConnection()` on the buddy (the file sender). But apparently
it takes a moment (perhaps a roundtrip through the kernel) for the incoming
data to stop, and that used to cause an error. In May 2020 this happened 11
times in 40 days. Now we just ignore this late data.
2020-05-21 22:48:07 -07:00
Joe Harrison
912cfa69b6 maintain python2.7 regex library compatibility 2020-03-08 21:13:49 +00:00
Joe Harrison
0dab7a4c63 restore impatient disconnect when message received after handshake but before sent_ok 2020-03-08 19:57:44 +00:00
Joe Harrison
8f89c8aaff inline handshake parsing and explain MAX_LENGTH for transit server 2020-03-08 19:54:42 +00:00
Joe Harrison
4fdd89cb35 use line receiver to simplify handshake logic 2020-03-07 02:14:04 +00:00