Blame SOURCES/BZ-1017491-respond-to-ctrl-c.patch

2a745b
commit 42b5945c99d92d55b5d401f2d934fe8fcc19f98b
2a745b
Author: Zdenek Pavlas <zpavlas@redhat.com>
2a745b
Date:   Mon Nov 4 15:32:43 2013 +0100
2a745b
2a745b
    Tell curl to return immediately on ctrl-c. BZ 1017491
2a745b
2a745b
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
2a745b
index 03fa1ba..579c2ff 100644
2a745b
--- a/urlgrabber/grabber.py
2a745b
+++ b/urlgrabber/grabber.py
2a745b
@@ -1903,6 +1903,8 @@ class PyCurlFileObject(object):
2a745b
             urllib.addinfourl, via. urllib.URLopener.* """
2a745b
         return self.url
2a745b
         
2a745b
+# tell curl to return immediately on ctrl-c
2a745b
+pycurl.global_init(pycurl.GLOBAL_DEFAULT | pycurl.GLOBAL_ACK_EINTR)
2a745b
 _curl_cache = pycurl.Curl() # make one and reuse it over and over and over
2a745b
 
2a745b
 def reset_curl_obj():
2a745b
commit 857af5ac1cec0a06755b75286ae2192e398cd341
2a745b
Author: Zdenek Pavlas <zpavlas@redhat.com>
2a745b
Date:   Wed Dec 18 13:12:00 2013 +0100
2a745b
2a745b
    Don't fail with older pycurl.
2a745b
2a745b
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
2a745b
index 579c2ff..ef18d6a 100644
2a745b
--- a/urlgrabber/grabber.py
2a745b
+++ b/urlgrabber/grabber.py
2a745b
@@ -1903,8 +1903,9 @@ class PyCurlFileObject(object):
2a745b
             urllib.addinfourl, via. urllib.URLopener.* """
2a745b
         return self.url
2a745b
         
2a745b
-# tell curl to return immediately on ctrl-c
2a745b
-pycurl.global_init(pycurl.GLOBAL_DEFAULT | pycurl.GLOBAL_ACK_EINTR)
2a745b
+if hasattr(pycurl, 'GLOBAL_ACK_EINTR'):
2a745b
+    # fail immediately on ctrl-c
2a745b
+    pycurl.global_init(pycurl.GLOBAL_DEFAULT | pycurl.GLOBAL_ACK_EINTR)
2a745b
 _curl_cache = pycurl.Curl() # make one and reuse it over and over and over
2a745b
 
2a745b
 def reset_curl_obj():
2a745b
commit bf0a0be71373dec515bbb54e0613a3b9b0c00b04
2a745b
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
2a745b
Date:   Tue Feb 4 10:11:58 2014 +0100
2a745b
2a745b
    Treat curl errcodes 42, 55, 66 as Ctrl-C BZ#1017491
2a745b
2a745b
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
2a745b
index 04f1179..f8deeb8 100644
2a745b
--- a/urlgrabber/grabber.py
2a745b
+++ b/urlgrabber/grabber.py
2a745b
@@ -1517,7 +1517,7 @@ class PyCurlFileObject(object):
2a745b
                 err.url = errurl
2a745b
                 raise err
2a745b
                 
2a745b
-            elif errcode == 42:
2a745b
+            elif errcode in (42, 55, 56):
2a745b
                 # this is probably wrong but ultimately this is what happens
2a745b
                 # we have a legit http code and a pycurl 'writer failed' code
2a745b
                 # which almost always means something aborted it from outside