Skip to content
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 ReadBuffer() #2005

Merged
merged 1 commit into from
Nov 5, 2019
Merged

fix ReadBuffer() #2005

merged 1 commit into from
Nov 5, 2019

Conversation

eycorsican
Copy link
Contributor

Revert changes introduced in 844f693, fixes #1872 and #1974.

Holding one byte in advance would cause ReadFrom() blocks till timeout in case the remote server has just one byte to send, which is exactly how iperf3 server behaves.

@kslr
Copy link
Contributor

kslr commented Nov 5, 2019

@vcptr

@kslr kslr merged commit 9a06ff8 into v2ray:master Nov 5, 2019
@vcptr
Copy link
Contributor

vcptr commented Nov 6, 2019

For recording purpose:

The one-byte buffer was introduce at 0f63be6 and the function renamed from readOne to ReadBuffer at f7abe35 during the integration of the quic protocol, but later the call to buf.ReadBuffer was removed at 6a0b3af , and buf.ReadBuffer is not called anywhere else other than inside buf package.

It's safe to get rid of the one-byte buffer mechanism.

@vcptr
Copy link
Contributor

vcptr commented Nov 20, 2019

maybe this commit needs to be reverted, for the commit cause multiple test cases failing.
I dug into one of the fail on http/proxy module, the failing of

go test -timeout 300s v2ray.com/core/testing/scenarios -run ^(TestHttpPost)$

The core encountered the following problem and closes the client connection.
The ReadVReader some how writes incorrect number of the buffer size to the remote.

2019/11/20 18:41:27 [Warning] [1325493970] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/http: connection ends > v2ray.com/core/proxy/http: failed to write whole request > http: ContentLength=65536 with Body length 65337

I can't not find the root cause of the issue at the moment, but the code works fine before this commit.

@eycorsican
Copy link
Contributor Author

I have created another PR #2041 to fix these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dokodemo-door端口转发iperf3失败
3 participants