[packages/rpm-build-tools/merge-pld-builder-client: 114/2675] - timeout compatible with python 2.4

glen glen at pld-linux.org
Mon Dec 19 21:58:30 CET 2016


commit 8fbb4f5389ec3fe5182ccbbb23460eda88daf645
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Aug 9 12:56:16 2010 +0000

    - timeout compatible with python 2.4
    
    Changed files:
        client/make-request.sh -> 1.77

 make-request.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/make-request.sh b/make-request.sh
index 8abac9b..2cc4dae 100644
--- a/make-request.sh
+++ b/make-request.sh
@@ -66,13 +66,14 @@ send_request() {
 	*)
 		echo >&2 "* Sending using http mode to $url"
 		cat - | python -c '
-import sys, urllib2
+import sys, socket, urllib2
 
 try:
         data = sys.stdin.read()
         url = sys.argv[1]
+        socket.setdefaulttimeout(10)
         req = urllib2.Request(url, data)
-        f = urllib2.urlopen(req, timeout = 10)
+        f = urllib2.urlopen(req)
         f.close()
 except Exception, e:
         print >> sys.stderr, "Problem while sending request via HTTP: %s: %s" % (url, e)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/cca6584b96e6c33d0732d559e43e100d804e2ecd



More information about the pld-cvs-commit mailing list