[Python-modules-commits] r27035 - in packages/pycurl/trunk/debian (3 files)

morph at users.alioth.debian.org morph at users.alioth.debian.org
Sat Jan 4 16:16:03 UTC 2014


    Date: Saturday, January 4, 2014 @ 16:16:03
  Author: morph
Revision: 27035

removed 40_add_CURLOPT_SEEKFUNCTION_and_CURLOPT_SEEKDATA.patch too

Modified:
  packages/pycurl/trunk/debian/changelog
  packages/pycurl/trunk/debian/patches/series
Deleted:
  packages/pycurl/trunk/debian/patches/40_add_CURLOPT_SEEKFUNCTION_and_CURLOPT_SEEKDATA.patch

Modified: packages/pycurl/trunk/debian/changelog
===================================================================
--- packages/pycurl/trunk/debian/changelog	2014-01-04 16:14:41 UTC (rev 27034)
+++ packages/pycurl/trunk/debian/changelog	2014-01-04 16:16:03 UTC (rev 27035)
@@ -4,10 +4,11 @@
   * debian/patches/10_setup.py.patch
     - refreshed, due to new upstream code
   * debian/patches/{20_remove_string_options.patch,
-      30_fix_refcounts_calling_reset_twice.patch}
+      30_fix_refcounts_calling_reset_twice.patch,
+      40_add_CURLOPT_SEEKFUNCTION_and_CURLOPT_SEEKDATA.patch}
     - removed, merged upstream
 
- -- Sandro Tosi <morph at debian.org>  Sat, 04 Jan 2014 17:14:15 +0100
+ -- Sandro Tosi <morph at debian.org>  Sat, 04 Jan 2014 17:15:47 +0100
 
 pycurl (7.19.0-7) unstable; urgency=low
 

Deleted: packages/pycurl/trunk/debian/patches/40_add_CURLOPT_SEEKFUNCTION_and_CURLOPT_SEEKDATA.patch
===================================================================
--- packages/pycurl/trunk/debian/patches/40_add_CURLOPT_SEEKFUNCTION_and_CURLOPT_SEEKDATA.patch	2014-01-04 16:14:41 UTC (rev 27034)
+++ packages/pycurl/trunk/debian/patches/40_add_CURLOPT_SEEKFUNCTION_and_CURLOPT_SEEKDATA.patch	2014-01-04 16:16:03 UTC (rev 27035)
@@ -1,142 +0,0 @@
-Description: Added CURLOPT_SEEKFUNCTION, CURLOPT_SEEKDATA
-Origin: http://pycurl.cvs.sourceforge.net/viewvc/pycurl/pycurl/src/pycurl.c?r1=1.149&r2=1.150
-
---- pycurl-7.19.0.orig/src/pycurl.c	2010/04/28 16:02:41	1.149
-+++ pycurl-7.19.0/src/pycurl.c	2010/10/13 15:53:40	1.150
-@@ -1,4 +1,4 @@
--/* $Id: pycurl.c,v 1.149 2010/04/28 16:02:41 zanee Exp $ */
-+/* $Id: pycurl.c,v 1.150 2010/10/13 15:53:40 zanee Exp $ */
- 
- /* PycURL -- cURL Python module
-  *
-@@ -150,6 +150,7 @@
-     PyObject *debug_cb;
-     PyObject *ioctl_cb;
-     PyObject *opensocket_cb;
-+    PyObject *seek_cb;
-     /* file objects */
-     PyObject *readdata_fp;
-     PyObject *writedata_fp;
-@@ -727,6 +728,7 @@
-     self->debug_cb = NULL;
-     self->ioctl_cb = NULL;
-     self->opensocket_cb = NULL;
-+    self->seek_cb = NULL;
- 
-     /* Set file object pointers to NULL by default */
-     self->readdata_fp = NULL;
-@@ -1181,6 +1183,82 @@
-     goto silent_error;
- }
- 
-+static int
-+seek_callback(void *stream, curl_off_t offset, int origin)
-+{
-+    CurlObject *self;
-+    PyThreadState *tmp_state;
-+    PyObject *arglist;
-+    PyObject *result = NULL;
-+    int ret = 2;     /* assume error 2 (can't seek, libcurl free to work around). */
-+    PyObject *cb;
-+    int source = 0;     /* assume beginning */
-+
-+    /* acquire thread */
-+    self = (CurlObject *)stream;
-+    tmp_state = get_thread_state(self);
-+    if (tmp_state == NULL)
-+        return ret;
-+    PyEval_AcquireThread(tmp_state);
-+
-+    /* check arguments */
-+    switch (origin)
-+    {
-+      case SEEK_SET:
-+          source = 0;
-+          break;
-+      case SEEK_CUR:
-+          source = 1;
-+          break;
-+      case SEEK_END:
-+          source = 2;
-+          break;
-+      default:
-+          source = origin;
-+          break;
-+    }
-+    
-+    /* run callback */
-+    cb = self->seek_cb;
-+    if (cb == NULL)
-+        goto silent_error;
-+    arglist = Py_BuildValue("(i,i)", offset, source);
-+    if (arglist == NULL)
-+        goto verbose_error;
-+    result = PyEval_CallObject(cb, arglist);
-+    Py_DECREF(arglist);
-+    if (result == NULL)
-+        goto verbose_error;
-+
-+    /* handle result */
-+    if (result == Py_None) {
-+        ret = 0;           /* None means success */
-+    }
-+    else if (PyInt_Check(result)) {
-+        int ret_code = PyInt_AsLong(result);
-+        if (ret_code < 0 || ret_code > 2) {
-+            PyErr_Format(ErrorObject, "invalid return value for seek callback %d not in (0, 1, 2)", ret_code);
-+            goto verbose_error;
-+        }
-+        ret = ret_code;    /* pass the return code from the callback */
-+    }
-+    else {
-+        PyErr_SetString(ErrorObject, "seek callback must return 0 (CURL_SEEKFUNC_OK), 1 (CURL_SEEKFUNC_FAIL), 2 (CURL_SEEKFUNC_CANTSEEK) or None");
-+        goto verbose_error;
-+    }
-+
-+silent_error:
-+    Py_XDECREF(result);
-+    PyEval_ReleaseThread(tmp_state);
-+    return ret;
-+verbose_error:
-+    PyErr_Print();
-+    goto silent_error;
-+}
-+
-+
-+
-+
- static size_t
- read_callback(char *ptr, size_t size, size_t nmemb, void *stream)
- {
-@@ -1988,7 +2066,8 @@
-         const curl_progress_callback pro_cb = progress_callback;
-         const curl_debug_callback debug_cb = debug_callback;
-         const curl_ioctl_callback ioctl_cb = ioctl_callback;
--	const curl_opensocket_callback opensocket_cb = opensocket_callback;
-+        const curl_opensocket_callback opensocket_cb = opensocket_callback;
-+        const curl_seek_callback seek_cb = seek_callback;
- 
-         switch(option) {
-         case CURLOPT_WRITEFUNCTION:
-@@ -2046,6 +2125,13 @@
-             curl_easy_setopt(self->handle, CURLOPT_OPENSOCKETFUNCTION, opensocket_cb);
-             curl_easy_setopt(self->handle, CURLOPT_OPENSOCKETDATA, self);
-             break;
-+        case CURLOPT_SEEKFUNCTION:
-+            Py_INCREF(obj);
-+            ZAP(self->seek_cb);
-+            self->seek_cb = obj;
-+            curl_easy_setopt(self->handle, CURLOPT_SEEKFUNCTION, seek_cb);
-+            curl_easy_setopt(self->handle, CURLOPT_SEEKDATA, self);
-+            break;
- 
-         default:
-             /* None of the function options were recognized, throw exception */
-@@ -3616,6 +3702,7 @@
-     insint_c(d, "PREQUOTE", CURLOPT_PREQUOTE);
-     insint_c(d, "WRITEHEADER", CURLOPT_WRITEHEADER);
-     insint_c(d, "HEADERFUNCTION", CURLOPT_HEADERFUNCTION);
-+    insint_c(d, "SEEKFUNCTION", CURLOPT_SEEKFUNCTION);
-     insint_c(d, "COOKIEFILE", CURLOPT_COOKIEFILE);
-     insint_c(d, "SSLVERSION", CURLOPT_SSLVERSION);
-     insint_c(d, "TIMECONDITION", CURLOPT_TIMECONDITION);

Modified: packages/pycurl/trunk/debian/patches/series
===================================================================
--- packages/pycurl/trunk/debian/patches/series	2014-01-04 16:14:41 UTC (rev 27034)
+++ packages/pycurl/trunk/debian/patches/series	2014-01-04 16:16:03 UTC (rev 27035)
@@ -1,3 +1,2 @@
 10_setup.py.patch
-40_add_CURLOPT_SEEKFUNCTION_and_CURLOPT_SEEKDATA.patch
 50_dont_leak_user_agent.patch




More information about the Python-modules-commits mailing list