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 703505 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 V2
0103-pycurl.c-allow-to-use-CURL_WRITEFUNC_PAUSE.patch (text/plain), 3.04 KB, created by
Kamil Dudka
on 2013-02-27 15:55:13 UTC
(
hide
)
Description:
proposed fix V2
Filename:
MIME Type:
Creator:
Kamil Dudka
Created:
2013-02-27 15:55:13 UTC
Size:
3.04 KB
patch
obsolete
>From 7806db0d371d32c56a8c3b82e5916798128c874a 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 | 10 +--------- > 1 files changed, 1 insertions(+), 9 deletions(-) > >diff --git a/src/pycurl.c b/src/pycurl.c >index 74f5248..f197145 100644 >--- a/src/pycurl.c >+++ b/src/pycurl.c >@@ -1080,15 +1080,7 @@ util_write_callback(int flags, char *ptr, size_t size, size_t nmemb, void *strea > if (result == Py_None) { > ret = total_size; /* None means success */ > } >- 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 */ >- } >- else if (PyLong_Check(result)) { >+ else if (PyInt_Check(result) || 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); >-- >1.7.1 > > >From 75e87ec284dd639f116c810a5482ac0e347f0212 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 > >... and returning -1 from the write call-back to abort the transfer > >Reported By: Zdenek Pavlas >Bug: https://bugzilla.redhat.com/857875 >--- > src/pycurl.c | 11 +++++------ > 1 files changed, 5 insertions(+), 6 deletions(-) > >diff --git a/src/pycurl.c b/src/pycurl.c >index f197145..b59eeb8 100644 >--- a/src/pycurl.c >+++ b/src/pycurl.c >@@ -1081,12 +1081,8 @@ util_write_callback(int flags, char *ptr, size_t size, size_t nmemb, void *strea > ret = total_size; /* None means success */ > } > else if (PyInt_Check(result) || 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 */ >+ /* if the cast to long fails, PyLong_AsLong() returns -1L */ >+ ret = (size_t) PyLong_AsLong(result); > } > else { > PyErr_SetString(ErrorObject, "write callback must return int or None"); >@@ -3423,6 +3419,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
Flags:
zpavlas
: review+
zpavlas
: review+
Actions:
View
|
Diff
Attachments on
bug 857875
:
613627
|
658097
|
703018
|
703490
| 703505 |
703527
|
705949