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

question: net/http: how do I set a timeout for ReadResponse #29749

Closed
schmilmo opened this issue Jan 15, 2019 · 2 comments
Closed

question: net/http: how do I set a timeout for ReadResponse #29749

schmilmo opened this issue Jan 15, 2019 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@schmilmo
Copy link

Hi,

I'm using http.ReadResponse for a HTTP sniffer I'm building.
Is there anyway to set a timeout for the like the one set for client.Get()?

Samuel

@andybons andybons changed the title Setting timeout for Readresponse question: net/http: how do I set a timeout for ReadResponse May 14, 2019
@andybons andybons added this to the Unreleased milestone May 14, 2019
@andybons
Copy link
Member

It's hard to answer without seeing code, but you can set various deadlines on a net.Conn if you're using one to construct the bufio.Reader passed to ReadResponse. See https://golang.org/pkg/net/#Conn for more info.

Are you able to share code?

@andybons andybons added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 14, 2019
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Jun 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants