- FOREACH_KEY(zoption, header_key, header_idx) {
- if (header_key) {
- zval **header_val;
- if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void **) &header_val)) {
- char header[1024] = {0};
- snprintf(header, 1023, "%s: %s", header_key, Z_STRVAL_PP(header_val));
- headers = curl_slist_append(headers, http_curl_copystr(header));
- }
-
- /* reset */
- header_key = NULL;
- }
- }
-
- if (headers) {
- curl_easy_setopt(ch, CURLOPT_HTTPHEADER, headers);
- }
+ /* maxfilesize */
+ if (zoption = http_curl_getopt1(options, "maxfilesize", IS_LONG)) {
+ curl_easy_setopt(ch, CURLOPT_MAXFILESIZE, Z_LVAL_P(zoption));
+ }
+
+ /* lastmodified */
+ if (zoption = http_curl_getopt1(options, "lastmodified", IS_LONG)) {
+ curl_easy_setopt(ch, CURLOPT_TIMECONDITION, range_req ? CURL_TIMECOND_IFUNMODSINCE : CURL_TIMECOND_IFMODSINCE);
+ curl_easy_setopt(ch, CURLOPT_TIMEVALUE, Z_LVAL_P(zoption));
+ }
+
+ /* timeout */
+ if (zoption = http_curl_getopt1(options, "timeout", IS_LONG)) {
+ curl_easy_setopt(ch, CURLOPT_TIMEOUT, Z_LVAL_P(zoption));
+ }
+
+ /* connecttimeout */
+ if (zoption = http_curl_getopt1(options, "connecttimeout", IS_LONG)) {
+ curl_easy_setopt(ch, CURLOPT_CONNECTTIMEOUT, Z_LVAL_P(zoption));