-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: add backgroundRead for plain http inbound #952
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
background Read 在 readRequest 结束之后进行,在 no keepalive 的 conn 中相当于检查conn健康性。 以上思路和表述均来自标准库 https://github.com/golang/go/blob/go1.21.5/src/net/http/server.go#L682 |
@hunshcn 然而你的 |
@wwqgtxx 确实是这样,已加锁 |
根据golang最新的commit,1.23将会禁止linkname到 |
我们可以在 req.Body 做一次包裹,这样可以自行实现 registerOnHitEOF,并且弄起来也挺简单。 话说是怎么找到这个未发布的 cl 的。 |
其实就是顺手翻了翻master上的最新commit
看了一下目前的源码,总觉并不太容易实现,有没有兴趣发个PR处理一下 |
在 client.Do 之前对 request.Body 取出来然后做个包裹然后重写 Read,在 Read 获得 EOF 的时候调用 onHitEOF。和标准库里面实现逻辑一致。 |
…BodyRemains (#1275) relate to #952 (comment)
fix #951