mirror of
https://github.com/snail007/goproxy.git
synced 2026-04-27 16:35:49 +03:00
[GH-ISSUE #151] 关于proxy何时Close上下游连接的讨论 #84
Labels
No labels
TODO
bug
duplicate
enhancement
good first issue
help wanted
helpful
invalid
need-confirm
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/goproxy#84
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ansoda on GitHub (Sep 28, 2018).
Original GitHub issue: https://github.com/snail007/goproxy/issues/151
作为代理程序,上面给个参考改进讨论,不管是上下游的哪一方先主动中断连接,proxy都不应该主动的close掉与另外一方的连接。 IoBind这个函数中,proxy是不是应该先调用dst.CloseWrite(),等两方都主动断开连接后,proxy再调用两方的Close()。
这样既可以避免上下游一方先只关闭写通道但没有关闭读通道时造成数据读取不完整的问题,同时也可以减少服务器的time_wait过多的问题。