X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_request_api.h;h=318b6967690d6a97dca0ec84607f903fda41d1c8;hp=4a2de451c307be7d31c374df5baebd258d6b520c;hb=dc76f745ce61ab266f873e80a39604fa91875c3d;hpb=7fef44c902c86eebce30f36003a27905fbaeba65 diff --git a/php_http_request_api.h b/php_http_request_api.h index 4a2de45..318b696 100644 --- a/php_http_request_api.h +++ b/php_http_request_api.h @@ -35,13 +35,14 @@ typedef struct { phpstr response; } conv; - HashTable info; - struct { phpstr cookies; HashTable options; struct curl_slist *headers; } _cache; + + char _error[CURL_ERROR_SIZE+1]; + zval *_progress_callback; #ifdef ZTS void ***tsrm_ls; @@ -49,9 +50,10 @@ typedef struct { } http_request; -#define http_request_init(r) _http_request_init_ex((r), NULL, 0, NULL TSRMLS_CC) -#define http_request_init_ex(r, c, m, u) _http_request_init_ex((r), (c), (m), (u) TSRMLS_CC) -PHP_HTTP_API http_request *_http_request_init_ex(http_request *request, CURL *ch, http_request_method meth, const char *url TSRMLS_DC); +#define http_request_new() _http_request_init_ex(NULL, NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) +#define http_request_init(r) _http_request_init_ex((r), NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) +#define http_request_init_ex(r, c, m, u) _http_request_init_ex((r), (c), (m), (u) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) +PHP_HTTP_API http_request *_http_request_init_ex(http_request *request, CURL *ch, http_request_method meth, const char *url ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); #define http_request_dtor(r) _http_request_dtor((r)) PHP_HTTP_API void _http_request_dtor(http_request *request); @@ -62,6 +64,9 @@ PHP_HTTP_API void _http_request_free(http_request **request); #define http_request_reset(r) _http_request_reset(r) PHP_HTTP_API void _http_request_reset(http_request *r); +#define http_request_defaults(r) _http_request_defaults(r) +PHP_HTTP_API void _http_request_defaults(http_request *request); + #define http_request_prepare(r, o) _http_request_prepare((r), (o)) PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *options); @@ -69,7 +74,10 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti PHP_HTTP_API void _http_request_exec(http_request *request); #define http_request_info(r, i) _http_request_info((r), (i)) -PHP_HTTP_API void _http_request_info(r, i); +PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info); + +#define http_request_set_progress_callback(r, cb) _http_request_set_progress_callback((r), (cb)) +PHP_HTTP_API void _http_request_set_progress_callback(http_request *request, zval *cb); #endif #endif