Commit Graph

544 Commits

Author SHA1 Message Date
Brian Warner
8c67a98259 merge test_transit.py into test_server.py 2016-04-18 15:52:29 -07:00
Brian Warner
68b22bec97 remove --twisted, stop using blocking-flavor scripts 2016-04-18 15:52:18 -07:00
Brian Warner
83c2612fc3 Require twisted (>=16.1.0) all the time.
The core Wormhole exchange will retain a blocking/non-Twisted
implementation, but the file-transferring Transit class is going to be
Twisted-only (maybe Twisted+asyncio). I want to improve the
protocol (add more parallelism, reduce round-trips), and the blocking
implementation is a messy bundle of threads and ick.

When this process is done (eventually), I'll be splitting out the
blocking Wormhole class into a separate distribution, which doesn't
depend upon Twisted.
2016-04-18 15:47:05 -07:00
Brian Warner
94a3be91b2 add tab-completion to twisted-style input_code() 2016-04-15 17:27:32 -07:00
Brian Warner
c856081a58 tox: we no longer need twisted-trunk, 16.1.0 is good 2016-04-15 16:09:23 -07:00
Brian Warner
bac484c2f1 add NEWS for 0.7.0 release 2016-03-28 02:44:01 -07:00
Brian Warner
ab7ed694c7 .appveyor.yml: remove 'meta' environment, we don't have one 2016-03-28 02:42:33 -07:00
Brian Warner
e04e84009e Merge branch 'tor': preliminary Tor support 2016-03-28 02:26:29 -07:00
Brian Warner
589226f076 tor: add comments, let it pick its own control port 2016-03-28 02:26:11 -07:00
Brian Warner
618706681a record time spent importing code 2016-03-28 02:25:40 -07:00
Brian Warner
9630ab9aae find-tor: record more detailed timings 2016-03-28 02:25:32 -07:00
Brian Warner
12c4c51fd8 record tor-launch time in DebugTiming 2016-03-28 02:25:01 -07:00
Brian Warner
01ed9902de add --tor support 2016-03-28 02:25:01 -07:00
Brian Warner
ed6e5ff169 get a TorManager working 2016-03-28 02:25:01 -07:00
Brian Warner
049fac01db tolerate trailing slash on "wormhole send dirname/"
Previously, the trailing slash would cause the receiving side to get an
empty-named directory.
2016-03-24 08:46:29 -07:00
Brian Warner
5a018c23f4 dump-timing: try to display the server-sent time usefully
Not really satisfied yet.
2016-03-03 18:06:26 -08:00
Brian Warner
c5415495c0 dump-timing: store server-sent time too
Adjust dump-timing to ignore the extra data, for now. Also do some
general instrumentation cleanup.
2016-03-03 18:03:27 -08:00
Brian Warner
aaf4e70a33 remove obsolete TODO 2016-03-03 17:56:15 -08:00
Brian Warner
626732b730 relay_server: include 'sent' timestamp with each message
This will be used by client-side timeline instrumentation, to guide
performance improvements.
2016-03-03 17:52:59 -08:00
Brian Warner
e342236b7d relay_server: internal rearrangement
Construct the response in the render_* method, rather than
add_messages(), to prepare for adding server timestamps. Use
json_response() everywhere.
2016-03-03 16:57:44 -08:00
Brian Warner
9d7b9dd8d2 add --no-listen, for debugging 2016-03-03 14:52:14 -08:00
Brian Warner
fdf96b07fe dump-timing: show elapsed time on click 2016-03-03 14:45:47 -08:00
Brian Warner
418fe9419e twisted: use persistent connections, slight speedup
This uses a single TCP connection to the relay server for all
requests (although it probably uses a second one for the downstream
EventSource feed). This should squeeze out some of the round-trip times.
2016-03-03 13:39:09 -08:00
Brian Warner
4f5e037d39 cmd-twisted: report exceptions better
The previous scheme would swallow the real traceback, making debugging
difficult.
2016-03-03 12:33:26 -08:00
Brian Warner
08a5e6043a twisted.transit: tolerate the lack of a listener
In Tor mode, there is no local listener. Eventually we'll add an Onion
Service listener, but it's not guaranteed that we can run one.
2016-03-03 12:32:26 -08:00
Brian Warner
8d92b40139 twisted.transcribe: use same Agent for ReconnectingEventSource
This will be especially important when we add Tor support.
2016-03-03 12:29:57 -08:00
Brian Warner
ca99784cd5 coveragerc: omit _version.py 2016-03-02 15:00:51 -08:00
Brian Warner
91269d18b1 README: Add codecov.io badge 2016-03-02 14:42:19 -08:00
Brian Warner
be2c66a5f5 transit: ignore errors on sockets we were about to close anyways 2016-03-02 14:28:04 -08:00
Brian Warner
60079a9fcf travis: add codecov, stop using tox, more
This runs tests directly (with 'coverage run' and 'trial'), rather than
running them inside tox, because that was proving difficult.

It upgrades pip first (the travis builders have an older version), to
use and cache wheels for speed. Travis is now configured to retain the
pip cache between runs.

This installs twisted from trunk (as tox was doing), to work around a
bug in the current twisted-15.5.0 release that should be resolved soon.

Travis is told to ignore any branch named WIP-, so I can transfer
branches between computers without causing red builds.

A coverage report is displayed before uploading to codecov.

The wormhole package is installed as --editable, to make the source
filenames in the coverage data match what I get at home. This also
appears necessary to get codecov to display the data (maybe it ignores
data for files outside the starting directory?).
2016-03-02 14:10:59 -08:00
Brian Warner
0e5286c7d3 .coveragerc: better config 2016-03-02 13:35:43 -08:00
Brian Warner
d86dc05b5f tox: remove 'meta', do pyflakes/smoketest in each build 2016-03-02 13:35:12 -08:00
Brian Warner
26f512fba4 add --twisted to use the twisted CLI flavor 2016-03-02 01:07:37 -08:00
Brian Warner
6d3d0c1cb3 unify synchronous calling of twisted CLI commands 2016-03-02 00:51:21 -08:00
Brian Warner
4d405c8cef cmd_send_twisted: fix display message ordering
By creating the ProgressingFileSender too early, it printed a progress
message before the "Sending" line.
2016-03-02 00:50:22 -08:00
Brian Warner
df2384bea2 twisted.transit: move FileConsumer into RecordPipe
This adds an expected= argument to Connection.connectConsumer(), which
then returns a Deferred that fires when enough bytes have been written
to the consumer. It also adds Connection.writeToFile(), a helper method
that writes bytes to a filehandle.
2016-03-02 00:48:43 -08:00
Brian Warner
7234e25897 twisted.transit: handle multiple records in one chunk
I made the classic dataReceived() mistake, and exited the function after
delivering the first record. Keep at it until there are no complete
records left.
2016-03-02 00:48:43 -08:00
Brian Warner
84749dd8b3 add misc/dump-timing.py too, to visualize the timeline 2016-03-01 18:23:19 -08:00
Brian Warner
8d82726c51 add DebugTiming object, --dump-timing= option
This writes timeline data to a .json file, which can be examined later
to find likely candidates for optimization.
2016-03-01 18:23:06 -08:00
Brian Warner
84def8a54b add some inlineCallbacks for simplicity
This control flow was getting too hairy.
2016-03-01 18:22:03 -08:00
Brian Warner
fd143caded tests.ServerBase: print message when threadpool is not idle
The previous commits improve test failures by dropping relay connections
at shutdown, and flunking a test quickly when one client fails but the
other one hangs.

If that doesn't work (say, some client has a time.sleep(), or other
stall that isn't affected by the relay shutdown), we'll be left with an
active thread holding that hanging client.

This patch adds a check to wormhole.test.common.ServerBase.tearDown that
looks for active threads, waits a second (after stopService), then
checks the threadpool again. If the threadpool is empty, everything is
fine. If not, it prints a message (to stdout) to inform the impatient
user why the test is probably hanging.
2016-03-01 17:07:48 -08:00
Brian Warner
b1dae14e6d test_scripts: handle hangs in one client
When test_scripts ran two clients at the same time, an error in one
could leave the other hanging (in a thread). One Deferred would errback,
the other would hang. Tests wait on one Deferred at a time, so if we're
unlucky and were waiting on the hanging Deferred (instead of the
erroring one), we'll wait forever, or at least until the default test
timeout of 180 seconds.

This adds an errback to notice when either client has errored, and
cancels the other Deferred, so it doesn't matter which one we wait upon
first.
2016-03-01 17:07:43 -08:00
Brian Warner
3fc3a563bf relay_server: disconnect clients upon shutdown 2016-03-01 17:07:37 -08:00
Brian Warner
0771aae7c7 server: Relay wasn't pruning channels
I forgot to hook it up to the service parent, so the timer was never
started.
2016-02-29 08:59:53 -08:00
Brian Warner
9293709e97 add NEWS for 0.6.3 release 2016-02-29 08:10:13 -08:00
Brian Warner
25ee48e989 add .coveragerc 2016-02-29 07:48:57 -08:00
Brian Warner
c225d57f8c cmd_receive_twisted.py: twisted-based implementation 2016-02-29 07:31:34 -08:00
Brian Warner
01064325a2 cmd_receive: refactor (slight message changes)
This prepares the way for a twisted-based implementation.
2016-02-29 07:30:40 -08:00
Brian Warner
6654efb429 move describe() from Transit to RecordPipe 2016-02-28 01:42:46 -08:00
Brian Warner
1903c58248 ipaddrs: return 127.0.0.1 if everything else fails
This helps the windows tests where ipaddrs currently fails entirely.
2016-02-27 17:37:12 -08:00