Commit Graph

503 Commits

Author SHA1 Message Date
Brian Warner
fb2ffe1963 add --signal-error to restart too 2016-05-24 12:59:02 -07:00
Brian Warner
a2b88dbf61 server: add --signal-error CLI argument 2016-05-24 12:46:42 -07:00
Brian Warner
a4ce663c31 tox.ini: pyflakes-1.2.3 is out, and works
This no longer suffers from the bug which caused pyflakes to crash when
it sees "from . import x".
2016-05-12 16:43:46 -07:00
Brian Warner
d725364a5e MANIFEST.in: don't include misc/web npm stuff 2016-05-08 23:27:31 -07:00
Brian Warner
8bf60d6562 update NEWS for 0.7.6 release 2016-05-08 23:19:15 -07:00
Brian Warner
54f6057191 overhaul dump-timing JS
Do all the work in JS.
2016-05-06 18:53:28 -07:00
Brian Warner
5501a6bf1c simplify timing, add msgid 2016-05-06 18:53:28 -07:00
Brian Warner
5530c33185 rdv_ws: send acks for each message
but only if the client is modern enough to include "id" in the message,
which lets us avoid sending acks to an 0.7.5 client (which would cause
them to abort, they don't like unrecognized server messages).

The acks let the client learn the server_rx time of messages that
terminate on the server, like "allocate" and "claim".
2016-05-06 18:51:28 -07:00
Brian Warner
644c7c6840 DB schema change: add/store/return msgid
This enables dump-timing to correlate sender logs with receiver logs.
2016-05-06 18:29:58 -07:00
Brian Warner
8a80242532 rdv_ws: deliver "server_tx", not "sent"
Update twisted/transcribe.py to accept it, update tests.
2016-05-06 18:29:58 -07:00
Brian Warner
d2dfc325d8 deliver stored server_rx to clients
This enables the "dump-timing" tools to display more information.
2016-05-06 18:29:58 -07:00
Brian Warner
959ab4baca rdv_ws: get server_rx at a better place 2016-05-06 18:29:58 -07:00
Brian Warner
d9ba55621b Channel.add_message(server_rx=): add new arg 2016-05-06 18:29:58 -07:00
Brian Warner
fe2dfc1a35 DB schema change: rename 'when' to 'server_rx' 2016-05-06 18:29:58 -07:00
Brian Warner
cd9f6e4377 ignore unknown rendezvous messages
I should have added this earlier, so 0.7.5 would be tolerant of new
server messages.
2016-05-06 18:29:19 -07:00
Brian Warner
3f5b66eddc pyflakes-1.2.2 is broken too 2016-05-06 15:45:48 -07:00
Brian Warner
7b6c015233 travis: use tox, temporarily disable coverage
I don't yet know how to get tox to run the equivalent of "coverage run
`which trial` wormhole.test", since tox doesn't use a shell. But I want
to switch travis to tox so we get the same dependencies (in particular
the pyflakes constraint) everywhere. I'll figure out how to re-enable
coverage data soon.
2016-05-06 09:00:02 -07:00
Brian Warner
46fb9d9cfc tox: reject pyflakes-1.2*, due to a bug
https://bugs.launchpad.net/pyflakes/+bug/1560134 causes an internal
error in pyflakes 1.2.0 and 1.2.1 when it encounters one of our "from .
import x" statements.
2016-05-06 08:54:25 -07:00
Brian Warner
a671982ab0 rdv: add comment 2016-05-05 19:13:05 -07:00
Brian Warner
58e95cff0d rdv_ws: avoid magic method-name concatenation 2016-05-05 19:11:21 -07:00
Brian Warner
a086effd52 cmd_send: time import of tor_manager too 2016-05-05 19:10:01 -07:00
Brian Warner
cfbd418898 rendezvous: minor refactoring 2016-05-05 18:21:06 -07:00
Brian Warner
8e664fdfcd timing.py: record finish(when) correctly 2016-04-30 15:48:43 -07:00
Brian Warner
37ecaebd3e Merge branch 'new-timing' 2016-04-29 14:41:54 -07:00
Brian Warner
7f65b13488 rewrite timeline with d3.js 2016-04-29 14:28:04 -07:00
Brian Warner
24e52c0320 rewrite timing instrumentation: use context managers 2016-04-29 14:27:29 -07:00
Brian Warner
b70c2f8868 Make get_verifier() wait for _confirm to arrive
This improves the error behavior when --verify is used but there's a
WrongPasswordError: the mismatch is detected before the verifiers are
displayed or confirmation is requested.

It requires that the far end sends a "_confirm" message, which was
introduced in release 0.6.0. Use with older versions (if it doesn't
break for other reasons) will cause a hang.

This patch also deletes test_twisted.Basic.test_verifier_mismatch, since
both sides now detect this on their own. It changes
test_wrong_password() too, since we might now notice the error during
send_data (previously we'd only see it in get_data).
2016-04-25 19:01:55 -07:00
Brian Warner
c017de5e4b cosmetic cleanups to error messages 2016-04-25 18:24:39 -07:00
Brian Warner
2a6767ee6f cmd_receive: internal error-handling cleanups 2016-04-25 18:24:18 -07:00
Brian Warner
a181a3fb35 WrongPasswordError: display docstring in str() 2016-04-25 18:16:08 -07:00
Brian Warner
1511f96c66 Clean up error handling, close channel upon error 2016-04-25 17:57:10 -07:00
Brian Warner
2f6caa04d3 test_scripts.Cleanup: new test
This asserts that we deallocate the rendezvous channel, even when we
terminate early due to errors.
2016-04-25 17:53:00 -07:00
Brian Warner
7e8bfe314d Call w.close() exactly once, in both success and error cases.
One downside is that we keep the wormhole channel allocated longer (we
have to finish the file transfer before we can deallocate it, which
could take a while for large files). Maybe we can fix this in the
future.
2016-04-25 17:53:00 -07:00
Brian Warner
34116c7b1f CLI: document and return correct errors
Also clean up test_scripts.PregeneratedCode:

* fetch results from both sides at the same time
* only check rc when using a subprocess, since the direct call doesn't
  use rc=0 anymore
* no need to cancel the other side's Deferred when one errors
* provide more information if stderr was non-empty
2016-04-25 17:52:59 -07:00
Brian Warner
e4a19748db CLI: don't catch+wrap WrongPasswordError
Also remove .explain, now that we no longer wrap it in TransferError
2016-04-25 17:52:59 -07:00
Brian Warner
b96b052c96 start on cleanups: error catching in CLI dispatch 2016-04-25 17:52:59 -07:00
Brian Warner
a4c1ba9e4e transcribe: stop automatically doing close() on error
And provide a close() that can live at the end of a Deferred chain, so
callers can do d.addBoth(w.close).

I like auto-close-on-error in general, but I'm removing it so I can
clean up the error-handling pathways. It will probably come back later.
The constraint is that it must be possible to wait on the return
Deferred that close() gives you (to synchronize tests, or keep the CLI
program running long enough to deallocate the channel) even if something
else (and error handler) called close() earlier. This will require
either a OneShotObserverList, or keeping a "deallocated" Deferred around
in case more callers want to wait on it later.
2016-04-25 17:50:52 -07:00
Brian Warner
8d0bcf9f82 transcribe._sleep: make it usable from deallocate()
If we're closing because of an error, we need to sleep through the old
error, to be able to wait for the "deallocated" message. This might want
to be different: maybe clear the error first, or store the errors in a
list and sleep until a second error happens.
2016-04-25 17:34:57 -07:00
Brian Warner
4eaf88d7d2 cmd: remove _twisted suffix from function names
No longer necessary now that all commands are twisted-based.
2016-04-24 22:49:18 -07:00
Brian Warner
b0da2a9ac7 cmd_send: fold helper routines back into main function
These were split out to make the blocking- and twisted- based
implementations share some code, but now that we're down to just
Twisted, it's clearer to merge them back in.
2016-04-24 22:46:21 -07:00
Brian Warner
35639dafed cmd_send: rearrange functions, no code changes 2016-04-24 22:40:25 -07:00
Brian Warner
754cabbdd8 Fail better when input-code is interrupted
Hitting Control-C (which sends SIGINT) while we're waiting in the
readline-based input_code() function didn't shut down the process
properly: the reactor would wait for the readline thread to exit, which
wouldn't happen until it finished getting a code, which requires the
user to hit Return. I haven't found a good way to force the thread to
exit, or to synthetically inject a newline into stdin. So my compromise
is to tell the user that they need to hit Return to finish interrupting
the command.

See the _warn_readline() function for a list of other potential
approaches.
2016-04-24 22:20:27 -07:00
Brian Warner
e8d3689a3a runner: display TransferErrors better
These are known failures (like file-not-found, transfer rejected, etc).
Display the error message, but not a traceback.
2016-04-24 12:10:51 -07:00
Brian Warner
86edf96412 switch to tqdm for nicer CLI progress bars 2016-04-24 12:04:05 -07:00
Brian Warner
16c6c0977e progress: make it easier to change display width 2016-04-23 22:43:42 -07:00
Brian Warner
79b3d30bbe MANIFEST: add missing files 2016-04-20 22:51:42 -07:00
Brian Warner
08b45e31da add NEWS for the 0.7.5 release 2016-04-20 22:44:04 -07:00
Brian Warner
1e7c714453 CLI: don't hide errors so much 2016-04-20 22:36:43 -07:00
Brian Warner
1b16127cad fix --tor
* twisted/transcribe: call correct tor_manager method
* tor_manager: remove now-unused web agent endpoint factory
2016-04-20 22:34:58 -07:00
Brian Warner
f3e310acbc travis: we no longer need twisted from trunk 2016-04-20 19:42:24 -07:00