1
0
mirror of https://github.com/golang/go synced 2024-11-24 21:00:09 -07:00

codereview: give up on http fetch after 30 seconds

If Python blocks in the SSL handshake it seems to be
completely uninterruptible, and I've been seeing it
block for at least hours recently. I don't know if the
problem is on the client side or the server side or
somewhere in the network, but setting the timeout
at least means you're guaranteed a new shell prompt
(after printing some errors).

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/7337048
This commit is contained in:
Russ Cox 2013-02-19 10:18:16 -05:00
parent cb32ea9c19
commit f19cf640d4

View File

@ -2444,6 +2444,8 @@ def MySend1(request_path, payload=None,
self._Authenticate()
if request_path is None:
return
if timeout is None:
timeout = 30 # seconds
old_timeout = socket.getdefaulttimeout()
socket.setdefaulttimeout(timeout)