magic-wormhole / magic-wormhole.rs

Rust implementation of Magic Wormhole, with new features and enhancements
European Union Public License 1.2
737 stars 81 forks source link

transfer: program not exiting when sending an empty file #160

Closed Max1Truc closed 2 years ago

Max1Truc commented 2 years ago

How to reproduce: wormhole-rs send /dev/null Then start receiving the file in another terminal.

wormhole-rs closes on the receiver side but not on the sender side.

Max1Truc commented 2 years ago

Note than then receiving with wormhole-william, the wormhole-rs sender exits as intended.

piegamesde commented 2 years ago

This is funny, because I'm pretty sure wormhole-william has the same bug too. Would you mind testing different transfers against different client combinations, to narrow things down some more?

Max1Truc commented 2 years ago
Sender Receiver Result Comment
:red_square: wormhole-rs :green_square: wormhole-william :heavy_check_mark::heavy_check_mark: works fine, waits ~1 second for no reason after transfer on both ends
:green_square: wormhole-william :red_square: wormhole-rs :heavy_check_mark::heavy_check_mark: works fine
:red_square: wormhole-rs :red_square: wormhole-rs :heavy_check_mark::heavy_check_mark: works fine
:green_square: wormhole-william :green_square: wormhole-william :heavy_check_mark::heavy_check_mark: works fine
:blue_square: magic-wormhole :blue_square: magic-wormhole :heavy_check_mark::heavy_check_mark: works fine
:blue_square: magic-wormhole :red_square: wormhole-rs :heavy_check_mark::heavy_check_mark: works fine
:blue_square: magic-wormhole :green_square: wormhole-william :heavy_check_mark::heavy_check_mark: works fine
:red_square: wormhole-rs :blue_square: magic-wormhole :heavy_check_mark::heavy_check_mark: works fine
:green_square: wormhole-william :blue_square: magic-wormhole :heavy_check_mark::heavy_check_mark: works fine
Max1Truc commented 2 years ago

Oh and I'm using the latest versions

$ wormhole --version
magic-wormhole 0.12.0
$ wormhole-rs --version
wormhole-rs 0.4.0
$ wormhole-william --version
wormhole-william version v1.0.6
Max1Truc commented 2 years ago

To narrow things down even more, when sending from wormhole-rs to wormhole-rs it depends on if you're using the relay.

Using the relay, everything works, while using the direct connection leaves the sender hanging.

piegamesde commented 2 years ago

(Whoops, sorry misclick)

I cannot reproduce locally, i.e. with sending with files from and to my machine. I'll try with a second machine soon.

I added a test in e6be77882bbecd1c6b8ad291188239ac2551cd23, and interestingly enough it fails but only on Windows …

Max1Truc commented 2 years ago

I'm actually on Manjaro Linux, with a simple firewall (allow out, deny in).

piegamesde commented 2 years ago

For the Rust<->Rust transfer, I tested some more different configurations and cannot reproduce. On the other hand, Rust<->Go hangs on both sides and in both directions.

Max1Truc commented 2 years ago

Oh, I don't know then. Sorry :P

Max1Truc commented 2 years ago

Maybe try forcing relay or direct mode ?

piegamesde commented 2 years ago

Tried both, no difference. The only clue I have at the moment is the test that I added which fails exclusively on Windows. However, I could not reproduce even that on a local test VM

Edit: I just noticed that I set FORCE_DIRECT in that test. Upon closer inspection, it fails because it cannot establish a connection, which is unrelated to the file size. So at the moment I have absolutely no clue about reproducing the Rust<->Rust case

piegamesde commented 2 years ago

@Max1Truc Would you mind trying out with latest Wormhole William again? They've had a fix and now all hangs I previously experienced are gone for me.

Max1Truc commented 2 years ago

Just updated to the last git version of wormhole-william.

It works on all configurations with wormhole-william now, I'm going to update the table. Note that on wormhole-rs -> wormhole-william it hangs a bit before exiting on both sides.

Max1Truc commented 2 years ago

@piegamesde Well, I just checked with wormhole-rs 0.4.0 (yeah the same version as when I opened the issue idk) and I can't reproduce anymore, consider this fixed x)

piegamesde commented 2 years ago

Thanks for investigating