Fixes for curl_setopt() and nullable values

From: Date: Wed, 27 Nov 2013 08:29:26 +0000
Subject: Fixes for curl_setopt() and nullable values
Groups: php.internals 
Request: Send a blank email to internals+get-70434@lists.php.net to get a copy of this message
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

« previous php.internals (#70434) next »