com php-src: don't compare constants on run time: ext/curl/interface.c
| From: | Anatol Belski | Date: | Fri, 28 Feb 2014 18:38:32 +0000 |
| Subject: | com php-src: don't compare constants on run time: ext/curl/interface.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76281@lists.php.net to get a copy of this message | ||
Commit: 36c445970eb9976119e6668dae6dbb9c7f79d5ce
Author: Anatol Belski <ab@php.net> Fri, 28 Feb 2014 19:38:32 +0100
Parents: 2e459be23727b15abe06b86fc997d9983dac17c7
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=36c445970eb9976119e6668dae6dbb9c7f79d5ce
Log:
don't compare constants on run time
Changed paths:
M ext/curl/interface.c
Diff:
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 0d96d1f..09e20d3 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -169,16 +169,20 @@ static int php_curl_option_str(php_curl *ch, long option, const char *str,
const
{
CURLcode error = CURLE_OK;
- if (make_copy || LIBCURL_VERSION_NUM < 0x071100) {
+#if LIBCURL_VERSION_NUM >= 0x071100
+ if (make_copy) {
+#endif
char *copystr;
/* Strings passed to libcurl as 'char *' arguments, are copied by the library since
7.17.0 */
copystr = estrndup(str, len);
error = curl_easy_setopt(ch->cp, option, copystr);
zend_llist_add_element(&ch->to_free->str, ©str);
+#if LIBCURL_VERSION_NUM >= 0x071100
} else {
error = curl_easy_setopt(ch->cp, option, str);
}
+#endif
SAVE_CURL_ERROR(ch, error)