Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7330 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 961 invoked by uid 1010); 26 Jan 2004 05:01:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 937 invoked from network); 26 Jan 2004 05:01:39 -0000 Received: from unknown (HELO smtp1.pp.htv.fi) (212.90.64.119) by pb1.pair.com with SMTP; 26 Jan 2004 05:01:39 -0000 Received: from localhost.localdomain (cs181008.pp.htv.fi [213.243.181.8]) by smtp1.pp.htv.fi (Postfix) with ESMTP id 7510C80FE7; Mon, 26 Jan 2004 07:01:38 +0200 (EET) Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.10/8.12.10) with ESMTP id i0Q51cpn006251; Mon, 26 Jan 2004 07:01:38 +0200 Date: Mon, 26 Jan 2004 07:01:37 +0200 (EET) Reply-To: Jani Taskinen To: root Cc: internals@lists.php.net In-Reply-To: <200401241340.i0ODegaq019260@gw.kuantic.com> Message-ID: References: <200401241340.i0ODegaq019260@gw.kuantic.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Bug in conditional compilation in ext/curl/interface.c, PHP5.0.0B3 From: sniper@iki.fi (Jani Taskinen) This is fixed in CVS. Thank you for letting us know about this. See: http://cvs.php.net/diff.php/php-src/ext/curl/interface.c?r1=1.30&r2=1.31&ty=u --Jani On Sat, 24 Jan 2004, root wrote: >Hi there. > >I was wondering why I was not able to get cURL use Digest Authentification. The >reason is the following: > >In ext/curl/interface.c, there is (lines 834-836) : > >---- >#ifdef CURLOPT_HTTPAUTH /* only in curl 7.10.6 */ > case CURLOPT_HTTPAUTH: >#endif >---- > >However, CURLOPT_HTTAUTH can't be tested that way since it's inside a enum. See >curl.h, line 314 (in curl.h from curl-7.11.0 for instance): > >---- >typedef enum { > CINIT(NOTHING, LONG, 0), /********* the first one is unused ************/ >---- >... etc .. until you have : >---- > /* Set this to a bitmask value to enable the particular authentications > methods you like. Use this in combination with CURLOPT_USERPWD. > Note that setting multiple bits may cause extra network round-trips. */ > CINIT(HTTPAUTH, LONG, 107), >---- > >So, if ever one wants to keep conditional compilation for this option, one >can use this ugly mess instead :-) : > >--- >#define CURL_HAS_HTTPAUTH > >#if LIBCURL_VERSION_MAJOR <= 7 >#if LIBCURL_VERSION_MAJOR < 7 >#undef CURL_HAS_HTTPAUTH >#else >#if LIBCURL_VERSION_MINOR < 10 >#undef CURL_HAS_HTTPAUTH >#else >#if LIBCURL_VERSION_MINOR == 10 >#if LIBCURL_VERSION_PATCH < 6 >#undef CURL_HAS_HTTPAUTH >#endif // LIBCURL_VERSION_PATCH < 6 >#endif // LIBCURL_VERSION_MINOR == 10 >#endif // LIBCURL_VERSION_MINOR < 10 >#endif // LIBCURL_VERSION_MAJOR < 7 >#endif // LIBCURL_VERSION_MAJOR <= 7 >--- > >and then use, in interface.c, lines 834-836: > >---- >#ifdef CURLOPT_HAS_HTTPAUTH /* only in curl 7.10.6 */ > case CURLOPT_HTTPAUTH: >#endif >---- > >However won't it be simpler to suppose that, with PHP5, cURL must be at least 7.11.0 and drop all that >tests? > >Now, to end that matter, I would have spared hours if, still in interface.c, I would have found, starting >line 1089: > >--- > default: > php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option"); > RETURN_FALSE; >--- > >Cheers, > > Bernard >