Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70434 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35656 invoked from network); 27 Nov 2013 08:29:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2013 08:29:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.179 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.220.179 mail-vc0-f179.google.com Received: from [209.85.220.179] ([209.85.220.179:64493] helo=mail-vc0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/71-24795-96DA5925 for ; Wed, 27 Nov 2013 03:29:29 -0500 Received: by mail-vc0-f179.google.com with SMTP id ie18so4542505vcb.24 for ; Wed, 27 Nov 2013 00:29:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ezKNE8wInEyxI7C45B6iGiZf1jIAdR8uiEE0VMztTWk=; b=0l6wjuNFQLoUDKKWYrF9PLEbxu5SkkwFAvAvkizqNJwqTZmdQRBakHHMbacdzme+Rx SNeFLK2VbFW5FasFPQmTqJyFsbZRYvV3EiwYgyyNuJEDFh9+ArQcNE+bpY4B4aNareNV nljW5mYRAgPu5iJBG1e9HZYRBlZXwu5FQX6oUFjU40/m1o1hrxDmfaN65tZBPy0ACNoA OpkrfQ5oTFkG8jF5ubqzzsRjMq05C7+DLRH1/q34phRvp6PvW0gXGW5PcG3Z/wKbL5ss 6la9cxm0oL0K+QPY33z2b2MfECCHFTIZz3cBH6XTlsF+Q8SpA+sdNfnJQ1eqasnTJuSd YRjA== MIME-Version: 1.0 X-Received: by 10.220.58.1 with SMTP id e1mr33564199vch.0.1385540966198; Wed, 27 Nov 2013 00:29:26 -0800 (PST) Received: by 10.58.128.33 with HTTP; Wed, 27 Nov 2013 00:29:26 -0800 (PST) Date: Wed, 27 Nov 2013 16:29:26 +0800 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=001a11c2c7da1cbaa004ec2465ec Subject: Fixes for curl_setopt() and nullable values From: tjerk.meesters@gmail.com (Tjerk Meesters) --001a11c2c7da1cbaa004ec2465ec Content-Type: text/plain; charset=ISO-8859-1 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 --001a11c2c7da1cbaa004ec2465ec--