Commit Graph

1441 Commits

Author SHA1 Message Date
Brian Warner
58cf584fb0 cmd_receive: treat 'quit' or other non- yes/no answers as "no"
So "yes" or "Yes" or "y" or "Y" or anything else that starts with y/Y means
yes, and a bare newline means yes, but anything else means no.
2019-05-29 23:32:02 -07:00
morrieinmaas
e2c678930c Closes #330 Changed default choice from No to Yes for wormhole receive 2019-05-18 15:57:03 -04:00
Brian Warner
293893ec01 Merge branch 'dilation-fixes' 2019-05-07 11:45:49 -07:00
Brian Warner
38f512e4cc open sc0 early, since messages can arrive attached to the KCM
Without this, the Follower would see data for subchannel 0 before it had a
chance to create the SubChannel object that could accept it. We already have
a mechanism for inbound data to be queued inside the SubChannel until the
endpoint has had a chance to create the Protocol object: we rely on that
mechanism here. We just need to create the SubChannel before telling the
Manager to start, even though we don't reveal the SubChannel to the
caller (via the control endpoint) until the connection is known to succeed.

This helps a manual test get data from one side to the other without throwing
exceptions.
2019-05-07 11:41:30 -07:00
Brian Warner
d612b58dd8 connection: tolerate merged KCM and first record
When the follower's connection is accepted, they'll observe a single
dataReceived chunk containing both the leader's KCM and the leader's first
actual data record. The state machine considers the KCM for an eventual-turn
before selecting the connection, so the data record will arrive while the
connection isn't quite ready for it (if consider() were immediate, this
wouldn't be a problem, but Automat doesn't deal with reentrant calls very
well). So we queue any records that arrive before we're selected.
2019-05-07 11:41:30 -07:00
Brian Warner
55056bd324 make no_listen= an argument to w.dilate() rather than create()
It wasn't exposed in create(), and I need it for more tests. This might not
be the best approach, I'll have to play with it a bit to tell.
2019-05-07 11:41:30 -07:00
Brian Warner
7eb1201379 connection: improve comments about protocol flow 2019-05-07 11:41:30 -07:00
Brian Warner
c933c5cc06 dilation-protocol.md: clarify a few things 2019-05-07 11:41:30 -07:00
Brian Warner
d9284cd4cb hints: avoid DNS lookups for all-numeric ipv4/ipv6 hints
This improves offline behavior for some tests, if we get spurious DNS lookup
errors.
2019-05-07 11:41:29 -07:00
Brian Warner
50c766f811 Merge branch 'fix-appveyor' 2019-05-06 01:29:12 -04:00
Brian Warner
34a190a6da dilate/connector: trap the right errors
If we had multiple potential connections, the act of cancelling the losing
ones was putting an error into log.err(), which flunked the tests. This
happened to appear on windows because the appveyor environment has different
interfaces than travis hosts.
2019-05-06 01:18:59 -04:00
Brian Warner
2d079e12e6 appveyor: set TOXENV separately for each python version
Builds are failing on appveyor because it's trying to install `noiseprotocol`
all the time, when it's only installable under py3.

Thanks to @julian and julian/jsonschema 's .appveyor for the hints.
2019-05-05 19:22:06 -04:00
Brian Warner
9e4e0850f1 Merge branch '321-docs-py3'
closes #321
2019-05-05 18:15:24 -04:00
Brian Warner
2f8873f50a docs/conf.py: add py2/py3-tolerance 2019-05-05 18:05:56 -04:00
Brian Warner
49ab25ff34 add 'tox -e docs', travis job to exercise it 2019-05-05 18:02:00 -04:00
Brian Warner
cedf549ccd docs/Makefile: add the missing newline 2019-05-05 17:42:57 -04:00
Brian Warner
995d3f546a Merge branch 'pr323' 2019-03-09 16:10:03 -08:00
Евгений Протозанов
9464fa91fc Added support for sending block devices 2019-02-22 14:15:58 +04:00
Brian Warner
a5e011f786 Merge branch 'dilate-xfer'
Add an integration test which exercises a full w.dilate connection and the
control endpoint.

Still untested:

* reconnecting after the initial TCP connection is lost
* resending data that wasn't acked before the connection was lost
* (re)sending data that was submitted while no connection was available
* the connect- and listen- endpoints
2019-02-10 18:07:03 -08:00
Brian Warner
bc863de634 dilate/test_full: enable, it works now 2019-02-10 18:02:29 -08:00
Brian Warner
c27680b910 terminator: shut down Dilator after everything else stops
This makes w.stop() the right way to shut everything down including any
Dilator connections (in-progress, active, or in-shutdown).
2019-02-10 18:01:14 -08:00
Brian Warner
7f90999775 test_full: finish test, although it still fails 2019-02-10 16:59:07 -08:00
Brian Warner
53ad951c11 DilatedConnectionProtocol/Role: prettier repr 2019-02-10 16:57:16 -08:00
Brian Warner
ebc63e52e0 add description to inbound connections 2019-02-10 16:52:17 -08:00
Brian Warner
74c416517f scids are four-byte strings, not integers
be consistent about it
2019-02-10 16:23:20 -08:00
Brian Warner
2ec7b8e662 update_ack_watermark takes seqnum, not record 2019-02-10 16:22:30 -08:00
Brian Warner
bf25dc68cf connector: use disconnect(), not loseConnection() 2019-02-10 15:57:55 -08:00
Brian Warner
0c9d2c927a fix hashability of dilation objects 2019-02-10 15:57:39 -08:00
Brian Warner
e4264971d7 add dilate/test_full, still failing 2019-02-10 11:51:54 -08:00
Brian Warner
a2a149946b test_connect: skip integration test when Noise is unavailable 2019-02-10 11:51:54 -08:00
Brian Warner
7f03adda3a dilate.test_connect: basic integration test
This mocks out the mailbox connection, and makes sure that endpoints are
constructed.
2019-02-10 11:51:54 -08:00
Brian Warner
059338a257 Add Dilator.stop(), fix delivery of connection made/lost messages
Dilator.stop() now shuts everything down, and returns a Deferred when it all
stops moving. This needed some Manager state machine changes (to notify
Dilator when it enters the STOPPED state). This also revealed problems in the
delivery of connector_connection_made() (which was misnamed) and
connector_connection_lost() (which wasn't being called at all).
2019-02-10 11:51:54 -08:00
Brian Warner
39fed50071 add no_listen=False to Manager and Dilator
This is only used by tests so far (and will simplify the integration test
that hasn't landed yet), but is not yet wired up to Boss, so there's no way
for applications to enable it yet.
2019-02-10 11:51:54 -08:00
Brian Warner
64618bcb64 manager: tidy up repr, leave out keys and some other fields 2019-02-10 11:51:54 -08:00
Brian Warner
b538dd6758 dilation.outbound: registerProducer goes on transport, not Protocol 2019-02-10 11:51:54 -08:00
Brian Warner
53ffbe1632 fix Noise handshake ordering
I mistakenly believed that Noise handshakes are simultaneous. In fact, the
Responder waits until it sees the Initiator's handshake before sending its
own. I had to update the Connection state machines to work this way (the
Record machine now has set_role_leader and set_role_follower), and update the
tests to match.

For debugging I added a `_role` property to Record, but it should probably be
removed.
2019-02-10 11:51:54 -08:00
Brian Warner
d1ff97f988 make some dilation objects hashable
necessary to include them in a set like _pending_connectors
2019-02-10 11:51:54 -08:00
Brian Warner
be2dc01a94 wormhole.py: add debug switch to enable dilation (for tests) 2019-02-10 11:47:28 -08:00
Brian Warner
6bd7e85a53 test_transit sometimes fails with EADDRINUSE on travis 2019-02-10 11:22:04 -08:00
Brian Warner
baf5ce4ead setup.py: hush deprecation warning
open(mode=U) is deprecated in py3, remove it
2019-02-10 11:18:48 -08:00
Brian Warner
66e227ee61 Merge branch 'tox-nodilate' 2019-02-10 11:17:15 -08:00
Brian Warner
41129faca5 travis: run flake8less, not the full flake8 2019-02-10 11:10:39 -08:00
Brian Warner
31de77a875 travis: py37 should no longer require sudo
(once upon a time, sudo:true was necessary to get onto a GCE instance, which
has xenail which has py37)
2019-02-10 11:08:00 -08:00
Brian Warner
b65678e5d2 travis: mark FLAKE8 build with an env 2019-02-10 11:07:43 -08:00
Brian Warner
42d849fe52 tox/travis: improve nodilate testing
'tox' run locally should only exercise sensible combinations (py27-nodilate,
py34-nodilate, py35/36/37 with dilate). Travis will run exactly these by
using a different script for each version of python. Also added a separate
flake8 builder (which uses a small subset of warnings, as the default set is
currently much too noisy).
2019-02-10 11:02:15 -08:00
Brian Warner
ddba0fc840 Merge branch 'dilate-5'
This adds (but does not enable/expose) the low-level code for the new
Dilation protocol (refs #312). The spec and docs are done, the unit tests
pass (with full branch coverage).

The next step is to write some higher-level integration tests, which use a
fake/short-circuited mailbox connection (Manager.send) but real localhost TCP
sockets.

Then we need to figure out backwards compatibility with non-dilation-capable
versions. I've got a table in my notes, I'll add it to the ticket.
2018-12-24 23:23:16 -05:00
Brian Warner
803aa07f35 travis: don't test dilation on py3.4 either 2018-12-24 23:00:00 -05:00
Brian Warner
942a04952f try to fix travis again
add a new tox target "no-dilate" to use on py2.7, and use "coverage"
everywhere else
2018-12-24 22:54:01 -05:00
Brian Warner
061ff98383 fix travis
don't run all of tox, just a single environment that uses the default
python (selected by travis)
2018-12-24 14:59:13 -05:00
Brian Warner
937a7d93e8 tox: only run coverage on py3.7
tox/coverage doesn't know to avoid the "dilate" extra, so it fails on py2.7
and py3.4
2018-12-24 14:49:25 -05:00