Commit Graph

109 Commits

Author SHA1 Message Date
meejah
0130e75514 unused 2021-02-12 22:01:35 -07:00
meejah
456a757019 not sure we can hit this state at all 2021-02-12 22:00:57 -07:00
meejah
7792e109ea re-instate log message 2021-02-12 21:59:47 -07:00
meejah
5c62ebc3c2 does this ever get called? 2021-02-12 21:46:32 -07:00
meejah
fb7f030910 guard 2021-02-12 20:52:14 -07:00
meejah
f8278b9db3 log again 2021-02-12 20:05:27 -07:00
meejah
acf4b00021 pyflakes 2021-02-12 18:17:09 -07:00
meejah
6fca7fc100 fix global stats-gathering / recording 2021-02-12 18:16:30 -07:00
meejah
e0c711ff0c cleanup / dead code 2021-02-12 17:47:40 -07:00
meejah
7a582370a3 restore 2 missing log-lines 2021-02-12 17:47:26 -07:00
meejah
ddaadddada pass actual database, not config 2021-02-12 17:46:43 -07:00
meejah
5552a75575 remove old test-code 2021-02-12 16:57:49 -07:00
meejah
651d12f7ea we never remove backends 2021-02-12 16:57:16 -07:00
meejah
8045892b03 cleanup, remove dead code 2021-02-12 16:35:20 -07:00
meejah
81ee2dc030 more stats / recording works 2021-02-12 02:18:36 -07:00
meejah
8d2e6abf2a use 'backends' for usage-recording 2021-02-12 01:32:52 -07:00
meejah
478a2eaedf unregister completely 2021-02-12 01:16:33 -07:00
meejah
76d471cdde count bytes missing 2021-02-12 01:09:39 -07:00
meejah
effd1a70d7 skip usage-counting if we're jilted but other side is happy? 2021-02-12 01:09:16 -07:00
meejah
aa7b6c3c7d fix more tests (that examine internals) 2021-02-12 00:50:05 -07:00
meejah
aa3c3d1f87 try to make 'redudant' mood work 2021-02-12 00:36:15 -07:00
meejah
9dfc410aa8 fix more tests 2021-02-12 00:35:52 -07:00
meejah
1ab5e4ffb3 start of refactoring usage-recording: pass one test 2021-02-12 00:06:19 -07:00
meejah
66f39dca47 count totals in state-machine 2021-02-01 16:55:15 -07:00
meejah
57f9c32b81 (wip) refactor to use Automat state-machine 2021-01-25 17:59:14 -07:00
meejah
6f0a0748f1 first-cut of state-machine style code 2021-01-19 16:01:29 -07:00
Brian Warner
46ec26f2bb Merge PR 14: improve tests
many thanks to @sigwinch28 for the improvements

closes #14
2020-05-23 17:53:21 -07:00
Brian Warner
ca309d5283 post-rebase: update newer tests 2020-05-23 17:50:26 -07: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
Brian Warner
851b7474d8 docs: explain --blur-usage= better
Thanks to @kaie in https://github.com/warner/magic-wormhole/issues/387 for
the suggestion.
2020-05-21 21:08:34 -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
Brian Warner
c6445321d7 update NEWS for 0.2.1 release 2019-09-11 00:25:26 -07:00
Brian Warner
9758d83279 fix IPv4/IPv6 listening port
whoops, it's "::" (the unspecified address), not "::1" (the loopback address)

refs #12
2019-09-11 00:23:50 -07:00
Brian Warner
d7b4919739 add news for 0.2.0 release 2019-09-10 23:25:28 -07:00
Brian Warner
c5afea6f9b docs: add pointer to a Dockerfile
Thanks to @ggeorgovassilis. Closes #11.
2019-09-10 23:19:16 -07:00
Brian Warner
42a293213b enable SO_KEEPALIVE on all connections
This timeout is notoriously long (about two hours), but it might eventually
prune stuck connections.

refs #9
2019-09-10 23:14:29 -07:00
Brian Warner
273c4d796c change default port= to listen on both IPv4+IPv6
The default was "tcp:4001", which happens to expand into
"tcp:4001:interface=127.0.0.1", which limits the listening socket to IPv4
connections only.

Changing it to "tcp:4001:interface=\:\:1" means "listen on ::1", which is the
IPv6 name for the loopback interface, and gets us a socket that accepts both
IPv4 and IPv6 connections.

Note: this might cause incompatibilities with IPv4-only hosts, if they don't
accept the "::1" name. For these systems, run the server as `twist
transitrelay --port=tcp:4001" to revert to the old behavior.

closes #12
2019-09-10 23:09:04 -07:00
Brian Warner
e9f166cb96 travis/tox/appveyor: remove py3.3 and py3.4
We support py2.7, and py3.5 and higher.
2019-09-10 23:07:09 -07:00
Brian Warner
6ceecb78bf add TODO for one of the moods 2019-09-10 23:05:22 -07:00
Brian Warner
bb1d52398c travis: test py3.7 too 2018-07-27 14:39:05 -07:00
Brian Warner
97a4f4e2b1 tox: add py37 2018-07-04 11:23:33 -07:00
Brian Warner
6e635f1af2 munin: fix +x on wormhole_transit_events_alltime 2018-03-28 14:23:50 -07:00
Brian Warner
0960cfa636 munin: move all plugins under a new "wormhole" category, not "network" 2018-03-28 14:14:31 -07:00
Brian Warner
faa8dba5e7 add news for 0.1.2 release 2018-03-19 22:37:28 -07:00