Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 703018 Details for
Bug 857875
write callback: No safe way to signal user abort
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
proposed fix
0103-pycurl.c-allow-to-use-CURL_WRITEFUNC_PAUSE.patch (text/plain), 3.44 KB, created by
Kamil Dudka
on 2013-02-26 16:33:04 UTC
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Kamil Dudka
Created:
2013-02-26 16:33:04 UTC
Size:
3.44 KB
patch
obsolete
>From f2f7678814d11defad99ffef13103807a6f06ddd Mon Sep 17 00:00:00 2001 >From: Kamil Dudka <kdudka@redhat.com> >Date: Tue, 26 Feb 2013 14:49:47 +0100 >Subject: [PATCH 1/2] pycurl.c: eliminate duplicated code in util_write_callback() > >Suggested by Zdenek Pavlas <https://bugzilla.redhat.com/857875#c8>. >--- > src/pycurl.c | 22 ++++++++++------------ > 1 files changed, 10 insertions(+), 12 deletions(-) > >diff --git a/src/pycurl.c b/src/pycurl.c >index 74f5248..851ca41 100644 >--- a/src/pycurl.c >+++ b/src/pycurl.c >@@ -1047,6 +1047,7 @@ util_write_callback(int flags, char *ptr, size_t size, size_t nmemb, void *strea > size_t ret = 0; /* assume error */ > PyObject *cb; > int total_size; >+ long obj_size; > > /* acquire thread */ > self = (CurlObject *)stream; >@@ -1079,28 +1080,25 @@ util_write_callback(int flags, char *ptr, size_t size, size_t nmemb, void *strea > /* handle result */ > if (result == Py_None) { > ret = total_size; /* None means success */ >+ goto done; > } > else if (PyInt_Check(result)) { >- long obj_size = PyInt_AsLong(result); >- if (obj_size < 0 || obj_size > total_size) { >- PyErr_Format(ErrorObject, "invalid return value for write callback %ld %ld", (long)obj_size, (long)total_size); >- goto verbose_error; >- } >- ret = (size_t) obj_size; /* success */ >+ obj_size = PyInt_AsLong(result); > } > else if (PyLong_Check(result)) { >- long obj_size = PyLong_AsLong(result); >- if (obj_size < 0 || obj_size > total_size) { >- PyErr_Format(ErrorObject, "invalid return value for write callback %ld %ld", (long)obj_size, (long)total_size); >- goto verbose_error; >- } >- ret = (size_t) obj_size; /* success */ >+ obj_size = PyLong_AsLong(result); > } > else { > PyErr_SetString(ErrorObject, "write callback must return int or None"); > goto verbose_error; > } > >+ if (obj_size < 0 || obj_size > total_size) { >+ PyErr_Format(ErrorObject, "invalid return value for write callback %ld %ld", obj_size, (long)total_size); >+ goto verbose_error; >+ } >+ ret = (size_t) obj_size; /* success */ >+ > done: > silent_error: > Py_XDECREF(result); >-- >1.7.1 > > >From affeb39764c59dc14295d015e1c02cb68806c4b8 Mon Sep 17 00:00:00 2001 >From: Kamil Dudka <kdudka@redhat.com> >Date: Tue, 26 Feb 2013 16:58:55 +0100 >Subject: [PATCH 2/2] pycurl.c: allow to use CURL_WRITEFUNC_PAUSE > >Reported By: Zdenek Pavlas >Bug: https://bugzilla.redhat.com/857875 >--- > src/pycurl.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > >diff --git a/src/pycurl.c b/src/pycurl.c >index 851ca41..a952afb 100644 >--- a/src/pycurl.c >+++ b/src/pycurl.c >@@ -1093,7 +1093,7 @@ util_write_callback(int flags, char *ptr, size_t size, size_t nmemb, void *strea > goto verbose_error; > } > >- if (obj_size < 0 || obj_size > total_size) { >+ if (obj_size < 0L) { > PyErr_Format(ErrorObject, "invalid return value for write callback %ld %ld", obj_size, (long)total_size); > goto verbose_error; > } >@@ -3429,6 +3429,9 @@ initpycurl(void) > /* Abort curl_read_callback(). */ > insint_c(d, "READFUNC_ABORT", CURL_READFUNC_ABORT); > >+ /* Pause curl_write_callback(). */ >+ insint_c(d, "WRITEFUNC_PAUSE", CURL_WRITEFUNC_PAUSE); >+ > /* constants for ioctl callback return values */ > insint_c(d, "IOE_OK", CURLIOE_OK); > insint_c(d, "IOE_UNKNOWNCMD", CURLIOE_UNKNOWNCMD); >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 857875
:
613627
|
658097
|
703018
|
703490
|
703505
|
703527
|
705949