]> Cypherpunks.ru repositories - gostls13.git/commitdiff
codereview: give up on http fetch after 30 seconds
authorRuss Cox <rsc@golang.org>
Tue, 19 Feb 2013 15:18:16 +0000 (10:18 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 19 Feb 2013 15:18:16 +0000 (10:18 -0500)
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

lib/codereview/codereview.py

index 9ac9dcb808a56aa3e2805b9412308bba166ade18..4b6014505f3d13be9dce75cbc5242ed6764e24e3 100644 (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)