lgtm.com noticed some unreachable code paths, and it turns out that nothing
in the rest of the code base could ever raise WormholeClosedError (I guess it
was leftover from before the big API refactoring). Both sender and receiver
are simpler without the unnecessary checks and state variables.
This comments out some "if 0: debug()" stuff I keep around to investigate
problems, since lgtm thinks of it as accidentally-unreachable code.
I also deleted a server usage command
entirely (src/wormhole/server/cmd_usage.py show_usage) which was disabled
while I rewrote that schema: the new plan is to move the server into a new
repository altogether, and use a completely different approach to the
usage database.
A slow Travis-CI host caused one the 1.0s KEY_TIMER to fire by accident,
making the test fail because it wasn't expecting to see the "please be
patient" message. Fixed this by increasing the timeout to a very large value
when we aren't explicitly testing it.
A tiny update to show the command to execute along with the code required on
the same line, rather than split across two lines. This small change helps
when sending the information to others using copy and paste.
Fixes#266
-=david=-
This removes the Transit Relay server from "wormhole-server", since it's been
split out into it's own package:
* https://github.com/warner/magic-wormhole-transit-relay
* https://pypi.python.org/pypi/magic-wormhole-transit-relay/0.1.0
The magic-wormhole tests now import that external
magic-wormhole-transit-relay package to exercise the client-side
functionality, as well as for the integration tests that do end-to-end
transfers. A normal "pip install magic-wormhole" will no longer include
transit-relay functionality.
The next step will be to remove the Rendezvous Server functionality too,
following the same path (create a new package, copy the server code into it,
get it working, remove that code from magic-wormhole, rewrite the tests to
import the external package).
This ought to help with #251, where bash-on-windows makes it easy to add a
forward-slash, and os.path.normpath() knows how to remove them, but os.sep is
a backslash.
Added the click option to look for relay and transit urls in environment
variables. If you're running your own relay/transit servers (such as
inside a corporate firewall), this will make client's lives easier.
If you pass --tor-control-port= and we can't use it, throw an error that will
kill the whole process, instead of falling back to the default SOCKS port.
If you omit --tor-control-port=, then if all default control port connections
fail, we'll fall back to the default SOCKS port.
Also, test each combination separately, and improve the status messages.
I should have added this when I switched to the new state machines, since
they definitely depend on attrs. The only reason this worked at all was that
some subdependency was also depending upon attrs.
We need at least 16.3.0, since we use __attrs_post_init__, and that feature
wasn't included in attrs-16.2.0 or earlier.
Closess #248
Linux defaults to a soft limit of 1024, which limits us to 512 simultaneous
non-transit-using connections. The transit relay runs in the same process, so
long-running relayed transfers will compete for those sockets too.
This raises the soft limit to equal the hard limit (if possible), or as much
as we can manage, if the soft limit was less than 10k. If the
resource.setrlimit calls aren't available (e.g. windows), or some other error
happens, this will log a message and continue without changing the limits.
closes#238