Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Add a read timeout for http.Client #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hoonmin
Copy link
Contributor

@hoonmin hoonmin commented Mar 5, 2015

Hi.
NewDockerClientTimeout() supports an option to set a timeout for HTTP request.
But currently it seems to set just a connection timeout with DialTimeout.
It could be good enough but I think we need a read timeout:

  • It's always possible to get slow responses.
  • When out-going packets are dropped in an established (keep-alive) connection, the connection timeout has no effect.

This PR includes:

  • Removed current DialTimeout().
  • Added Timeout field in http.Client. (only available for golang >= 1.3 though).

Thanks!

Signed-off-by: Hoonmin Kim <hoonmin.kim@navercorp.com>
@aluzzardi
Copy link
Collaborator

I like this.

@hoonmin Any way this could be tested?

/cc @vieux @ehazlett @donhcd @samalba

donhcd added a commit to donhcd/dockerclient that referenced this pull request May 12, 2015
donhcd added a commit to donhcd/dockerclient that referenced this pull request May 12, 2015
@donhcd
Copy link
Collaborator

donhcd commented May 12, 2015

👍 for testing. I made some hacky tests in a PR at https://github.com/hoonmin/dockerclient/pull/1/files and they don't pass... any idea why?

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

Successfully merging this pull request may close these issues.

None yet

3 participants