1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00

don't compare constants on run time

This commit is contained in:
Anatol Belski
2014-02-28 19:38:32 +01:00
parent 2e459be237
commit 36c445970e
+5 -1
View File
@@ -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, &copystr);
#if LIBCURL_VERSION_NUM >= 0x071100
} else {
error = curl_easy_setopt(ch->cp, option, str);
}
#endif
SAVE_CURL_ERROR(ch, error)