X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_client.c;h=160e8bbd809f9ebcc84c482723dec175bf313ad6;hp=4f0de3cb6fc604334470937c0881b4efea3e56a2;hb=c3f7d34f18cd62956f241092c67a38edf246328d;hpb=e867316f1364f589eec67cc684703c874984430b diff --git a/php_http_client.c b/php_http_client.c index 4f0de3c..160e8bb 100644 --- a/php_http_client.c +++ b/php_http_client.c @@ -20,12 +20,12 @@ */ static HashTable php_http_client_drivers; -STATUS php_http_client_driver_add(php_http_client_driver_t *driver) +ZEND_RESULT_CODE php_http_client_driver_add(php_http_client_driver_t *driver) { return zend_hash_add(&php_http_client_drivers, driver->name_str, driver->name_len + 1, (void *) driver, sizeof(php_http_client_driver_t), NULL); } -STATUS php_http_client_driver_get(const char *name_str, size_t name_len, php_http_client_driver_t *driver) +ZEND_RESULT_CODE php_http_client_driver_get(const char *name_str, size_t name_len, php_http_client_driver_t *driver) { php_http_client_driver_t *tmp; @@ -216,7 +216,7 @@ void php_http_client_free(php_http_client_t **h) { } } -STATUS php_http_client_enqueue(php_http_client_t *h, php_http_client_enqueue_t *enqueue) +ZEND_RESULT_CODE php_http_client_enqueue(php_http_client_t *h, php_http_client_enqueue_t *enqueue) { TSRMLS_FETCH_FROM_CTX(h->ts); @@ -231,7 +231,7 @@ STATUS php_http_client_enqueue(php_http_client_t *h, php_http_client_enqueue_t * return FAILURE; } -STATUS php_http_client_dequeue(php_http_client_t *h, php_http_message_t *request) +ZEND_RESULT_CODE php_http_client_dequeue(php_http_client_t *h, php_http_message_t *request) { TSRMLS_FETCH_FROM_CTX(h->ts); @@ -267,7 +267,7 @@ php_http_client_enqueue_t *php_http_client_enqueued(php_http_client_t *h, void * return el ? (php_http_client_enqueue_t *) el->data : NULL; } -STATUS php_http_client_wait(php_http_client_t *h, struct timeval *custom_timeout) +ZEND_RESULT_CODE php_http_client_wait(php_http_client_t *h, struct timeval *custom_timeout) { if (h->ops->wait) { return h->ops->wait(h, custom_timeout); @@ -285,7 +285,7 @@ int php_http_client_once(php_http_client_t *h) return FAILURE; } -STATUS php_http_client_exec(php_http_client_t *h) +ZEND_RESULT_CODE php_http_client_exec(php_http_client_t *h) { if (h->ops->exec) { return h->ops->exec(h); @@ -304,7 +304,7 @@ void php_http_client_reset(php_http_client_t *h) zend_llist_clean(&h->responses); } -STATUS php_http_client_setopt(php_http_client_t *h, php_http_client_setopt_opt_t opt, void *arg) +ZEND_RESULT_CODE php_http_client_setopt(php_http_client_t *h, php_http_client_setopt_opt_t opt, void *arg) { if (h->ops->setopt) { return h->ops->setopt(h, opt, arg); @@ -313,7 +313,7 @@ STATUS php_http_client_setopt(php_http_client_t *h, php_http_client_setopt_opt_t return FAILURE; } -STATUS php_http_client_getopt(php_http_client_t *h, php_http_client_getopt_opt_t opt, void *arg, void *res_ptr) +ZEND_RESULT_CODE php_http_client_getopt(php_http_client_t *h, php_http_client_getopt_opt_t opt, void *arg, void *res_ptr) { if (h->ops->getopt) { return h->ops->getopt(h, opt, arg, res_ptr); @@ -377,7 +377,7 @@ static void handle_history(zval *zclient, php_http_message_t *request, php_http_ zval_ptr_dtor(&new_hist); } -static STATUS handle_response(void *arg, php_http_client_t *client, php_http_client_enqueue_t *e, php_http_message_t **response) +static ZEND_RESULT_CODE handle_response(void *arg, php_http_client_t *client, php_http_client_enqueue_t *e, php_http_message_t **response) { zend_bool dequeue = 0; zval zclient; @@ -533,7 +533,7 @@ static PHP_METHOD(HttpClient, __construct) php_http_pretty_key(name_str + sizeof("http\\Client"), driver.name_len, 1, 1); if ((pf = php_persistent_handle_concede(NULL , name_str, name_len, persistent_handle_str, persistent_handle_len, NULL, NULL TSRMLS_CC))) { - rf = php_resource_factory_init(NULL, php_persistent_handle_get_resource_factory_ops(), pf, (void (*)(void *)) php_persistent_handle_abandon); + rf = php_persistent_handle_resource_factory_init(NULL, pf); } efree(name_str);