X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_request_api.c;h=3f77eff2ae55bc37e2ad541ed9bf1254a5f4e840;hb=8b0cff922b0538f98364943291ce0359c3da6d88;hp=aac05fd62f2937be778d4a75d089cd3868b01b28;hpb=c8ff1f2a523b5f914a7bae73bb6f29d40a0d3786;p=m6w6%2Fext-http diff --git a/http_request_api.c b/http_request_api.c index aac05fd..3f77eff 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -18,6 +18,15 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include "php.h" + +#include "php_http.h" +#include "php_http_std_defs.h" +#include "php_http_api.h" +#include "php_http_request_api.h" +#include "php_http_url_api.h" + +#include "phpstr/phpstr.h" #ifdef PHP_WIN32 # include @@ -25,21 +34,12 @@ #include -#include "phpstr/phpstr.h" - -#include "php.h" -#include "php_http.h" -#include "php_http_std_defs.h" -#include "php_http_api.h" -#include "php_http_request_api.h" -#include "php_http_url_api.h" +ZEND_EXTERN_MODULE_GLOBALS(http); #ifndef HTTP_CURL_USE_ZEND_MM # define HTTP_CURL_USE_ZEND_MM 0 #endif -ZEND_EXTERN_MODULE_GLOBALS(http) - #if LIBCURL_VERSION_NUM < 0x070c00 # define curl_easy_strerror(code) HTTP_G(request).error #endif @@ -507,7 +507,7 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char } else { HTTP_CURL_OPT(COOKIEFILE, NULL); } - + /* cookiestore, read initial cookies from that file and store cookies back into that file */ if ((zoption = http_curl_getopt(options, "cookiestore", IS_STRING)) && Z_STRLEN_P(zoption)) { HTTP_CURL_OPT(COOKIEFILE, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption))); @@ -540,18 +540,18 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char HTTP_CURL_OPT(TIMEVALUE, 0); } - /* timeout */ + /* timeout, defaults to 3 */ if (zoption = http_curl_getopt(options, "timeout", IS_LONG)) { HTTP_CURL_OPT(TIMEOUT, Z_LVAL_P(zoption)); } else { - HTTP_CURL_OPT(TIMEOUT, 1); + HTTP_CURL_OPT(TIMEOUT, 3); } - /* connecttimeout, defaults to 1 */ + /* connecttimeout, defaults to 3 */ if (zoption = http_curl_getopt(options, "connecttimeout", IS_LONG)) { HTTP_CURL_OPT(CONNECTTIMEOUT, Z_LVAL_P(zoption)); } else { - HTTP_CURL_OPT(CONNECTTIMEOUT, 1); + HTTP_CURL_OPT(CONNECTTIMEOUT, 3); } /* ssl */