curl-and-python

pycurl-7.15.4 error with vc71 (with patch)

From: K.S.Sreeram <sreeram_at_tachyontech.net>
Date: Tue, 27 Jun 2006 00:14:01 +0530

Hi All

I faced a simple compilation error in line 1830 of pycurl.c,
because a new variable of type (CurlShareObject *) is being declared in
the middle of a block (which is not allowed in C).

I used the attached trivial patch to fix it.

Regards
Sreeram

diff -urN pycurl-7.15.4.orig\src\pycurl.c pycurl-7.15.4\src\pycurl.c
--- pycurl-7.15.4.orig\src\pycurl.c Wed Jun 14 00:36:28 2006
+++ pycurl-7.15.4\src\pycurl.c Mon Jun 26 23:59:25 2006
@@ -1803,6 +1803,7 @@
     }
     /* handle the SHARE case */
     if (option == CURLOPT_SHARE) {
+ CurlShareObject *share;
         if (self->share == NULL && (obj == NULL || obj == Py_None)){
             Py_INCREF(Py_None);
             return Py_None;
@@ -1812,7 +1813,7 @@
                 PyErr_SetString(ErrorObject, "Curl object already sharing. Unshare first.");
                 return NULL;
             }else{
- CurlShareObject *share = self->share;
+ share = self->share;
                 res = curl_easy_setopt(self->handle, CURLOPT_SHARE, NULL);
                 if (res != CURLE_OK){
                     CURLERROR_RETVAL();
@@ -1827,7 +1828,7 @@
             PyErr_SetString(PyExc_TypeError, "invalid arguments to setopt");
             return NULL;
         }
- CurlShareObject *share = (CurlShareObject*)obj;
+ share = (CurlShareObject*)obj;
         res = curl_easy_setopt(self->handle, CURLOPT_SHARE, share->share_handle);
         if (res != CURLE_OK) {
             CURLERROR_RETVAL();

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python

Received on 2006-06-26