-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix regression: termination of long downloads after StreamTimeout seconds #141
Fix regression: termination of long downloads after StreamTimeout seconds #141
Conversation
- Even if not broadcasting in a loop, we still need to update the read deadline. - Don't enforce the timeout after the first data is written.
36e25dd
to
ee5968a
Compare
Codecov Report
@@ Coverage Diff @@
## master #141 +/- ##
==========================================
- Coverage 67.69% 67.61% -0.09%
==========================================
Files 37 37
Lines 2402 2399 -3
==========================================
- Hits 1626 1622 -4
Misses 612 612
- Partials 164 165 +1
Continue to review full report at Codecov.
|
I explained my reasoning and the correct behavior in my bug report on shadowsocks-rust, because it has the same bugs: shadowsocks/shadowsocks-rust#343 In case of Cloak since it is a point-to-point tunnel, for UDP it should be handled as TCP, only timeout on first byte. After that no timeout at all. |
I have been testing these changes now for many days, and so far Cloak is behaving properly now. I use it 24x7. |
I agree with you fully on points raised in shadowsocks/shadowsocks-rust#343 and Cloak should exihbit the same behaviour as shadowsocks-libev currently does. In terms of implementation, I think it's better to not change the behaviour of stream/datagramBufferedPipe, because they could be seen as standalone structures. The caller should be responsible in implementing the initial-timeout-only behaviour. In fact, I don't think we even need to change the multiplex module at all. Would it work if you keep these changes Cloak/internal/client/piper.go Lines 90 to 98 in 35e1129
Revert the changes in stream/datagramBufferedPipe.go And in dispatcher.go on server side, simply delete SetWriteToTimeout? Cloak/internal/server/dispatcher.go Lines 277 to 280 in 57138e8
Since streams in Cloak are lazily-opened, meaning that the server will only allocate resource for a stream once it receives data, there isn't any need even for initial timeout because we are always guaranteed to get data immediately on first read, meaning we don't need a timeout at all. |
Ok seems with your suggested changes things seem fine still. |
@cbeuw can we get review and merge please :-) this is a very annoying bug. |
Don't forget android also. |
Thanks! I'll do a new release once I merge the CDN PR |
Fixes #140