zval **header_val;
if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(zoption), (void **) &header_val, &pos)) {
char header[1024] = {0};
- zval *cpy, *val = convert_to_type_ex(IS_STRING, *header_val, &cpy);
- snprintf(header, 1023, "%s: %s", header_key, Z_STRVAL_P(val));
- request->_cache.headers = curl_slist_append(request->_cache.headers, header);
+ SEPARATE_ZVAL(header_val);
+ convert_to_string(*header_val);
- if (cpy) {
- zval_ptr_dtor(&cpy);
- }
+ snprintf(header, 1023, "%s: %s", header_key, Z_STRVAL_PP(header_val));
+ request->_cache.headers = curl_slist_append(request->_cache.headers, header);
}
/* reset */
}
}
+#if LIBCURL_VERSIONNUM >= 0x070f01
+ /* reset cookies */
+ if ((zoption = http_request_option(request, options, "resetcookies", IS_BOOL)) && Z_LVAL_P(zoption)) {
+ HTTP_CURL_OPT(COOKIELIST, "ALL");
+ }
+#endif
+
/* session cookies */
if ((zoption = http_request_option(request, options, "cookiesession", IS_BOOL))) {
if (Z_LVAL_P(zoption)) {