Hi,
A few weeks ago I stumbled upon the following question on stackoverflow:
http://stackoverflow.com/questions/4163865/how-to-reset-curlopt-customrequest
It involves the CURLOPT_CUSTOMREQUEST
option, which according to the
libcurl documentation can be set to NULL
to restore the previous behaviour
of passing the method name based on the type of request.
However, for string-based options the current code converts a NULL
value
into an empty string, so it's impossible to revert the behaviour.
After doing a quick hack I realized that there are more options that are
nullable, so I've decided to refactor some of the code to isolate the
string assignment; this makes adding future nullable options easier.
This is the pull request: https://github.com/php/php-src/pull/531
It passes the test cases on my machine (couldn't test all of them because
file uploads aren't supported when you use internal web server), but I
would appreciate a second look.
--
Tjerk
On Wed, Nov 27, 2013 at 4:29 PM, Tjerk Meesters tjerk.meesters@gmail.comwrote:
Hi,
A few weeks ago I stumbled upon the following question on stackoverflow:
http://stackoverflow.com/questions/4163865/how-to-reset-curlopt-customrequest
It involves the
CURLOPT_CUSTOMREQUEST
option, which according to the
libcurl documentation can be set toNULL
to restore the previous behaviour
of passing the method name based on the type of request.However, for string-based options the current code converts a
NULL
value
into an empty string, so it's impossible to revert the behaviour.After doing a quick hack I realized that there are more options that are
nullable, so I've decided to refactor some of the code to isolate the
string assignment; this makes adding future nullable options easier.This is the pull request: https://github.com/php/php-src/pull/531
It passes the test cases on my machine (couldn't test all of them because
file uploads aren't supported when you use internal web server), but I
would appreciate a second look.
I've made some tweaks based on Stanislav's suggestions.
If there are no further objections, could someone merge this to master or
give me (datibbaw) the required karma to do so? Thanks ^_^
--
Tjerk