|
|
cURL Mailing List Monthly Index Single Mail
curl-tracker mailing list Archives
[ curl-Bugs-2727981 ] Setting CURLOPT_NOBODY=0 resets httpreq to HTTPREQ_GET
From: SourceForge.net <noreply_at_sourceforge.net>
Date: Fri, 03 Apr 2009 20:29:04 +0000
Bugs item #2727981, was opened at 2009-04-03 11:15
Please note that this message will contain a full copy of the comment thread,
Initial Comment:
One possible scenario is if the user sets options in this order (it's perfectly reasonable to reset the _NOBODY setting if the curl handle has been used for other things earlier):
curl_easy_setopt(slot->curl, CURLOPT_PUT, 1);
The first setopt call sets httpreq to HTTPREQ_PUT in lib/url.c:914 (in 7.19.4), but the second call resets httpreq to HTTPREQ_GET in lib/url.c:896.
One workaround is simply to do all reset/disable settings before setting the new options.
Is this a bug, or should the documentation be updated to reflect this?
A sample patch is attached, which solves this particular case but doesn't handle all possible cases. One case it doesn't handle is setting CURLOPT_POST=1, then CURLOPT_NOBODY=0, which would require even more state to be saved or better handling in url.c. Or what about setting e.g. CURLOPT_POST=1, CUROPT_NOBODY=1, CURLOPT_NOBODY=0 - should such scenarios be supported?
The API makes it look like all these options modify distinct separate flags, even though they all modify one shared variable (and only some of them are stored as flags).
----------------------------------------------------------------------
>Comment By: Daniel Stenberg (bagder)
Message:
The main reason NOBODY=0 sets the request type is that because previously
I'm now thinking that perhaps the fix is rather to if NOBODY is set to 0,
Or what to you think?
----------------------------------------------------------------------
You can respond by visiting:
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info