get_storage() -> php_http_curl_client_get_storage()
authorMichael Wallner <mike@php.net>
Sun, 9 Dec 2012 22:20:24 +0000 (22:20 +0000)
committerMichael Wallner <mike@php.net>
Sun, 9 Dec 2012 22:20:24 +0000 (22:20 +0000)
php_http_curl_client.c
php_http_curl_client.h

index eb2b84095a64b5f5cafd00e14455fc8b8a643994..83640a30ef0cca30a1a880f0289d9a29ac56b4d7 100644 (file)
@@ -19,7 +19,7 @@ static void *php_http_curl_ctor(void *opaque TSRMLS_DC)
        void *ch;
 
        if ((ch = curl_easy_init())) {
-               get_storage(ch);
+               php_http_curl_client_get_storage(ch);
                return ch;
        }
        return NULL;
@@ -31,7 +31,7 @@ static void *php_http_curl_copy(void *opaque, void *handle TSRMLS_DC)
 
        if ((ch = curl_easy_duphandle(handle))) {
                curl_easy_reset(ch);
-               get_storage(ch);
+               php_http_curl_client_get_storage(ch);
                return ch;
        }
        return NULL;
@@ -39,7 +39,7 @@ static void *php_http_curl_copy(void *opaque, void *handle TSRMLS_DC)
 
 static void php_http_curl_dtor(void *opaque, void *handle TSRMLS_DC)
 {
-       php_http_curl_client_storage_t *st = get_storage(handle);
+       php_http_curl_client_storage_t *st = php_http_curl_client_get_storage(handle);
 
        curl_easy_cleanup(handle);
 
@@ -356,7 +356,7 @@ static STATUS get_info(CURL *ch, HashTable *info)
                }
        }
 #endif
-       add_assoc_string_ex(&array, "error", sizeof("error"), get_storage(ch)->errorbuffer, 1);
+       add_assoc_string_ex(&array, "error", sizeof("error"), php_http_curl_client_get_storage(ch)->errorbuffer, 1);
 
        return SUCCESS;
 }
@@ -388,7 +388,7 @@ static STATUS php_http_curl_client_option_set_cookiestore(php_http_option_t *opt
        CURL *ch = curl->handle;
 
        if (val) {
-               php_http_curl_client_storage_t *storage = get_storage(curl->handle);
+               php_http_curl_client_storage_t *storage = php_http_curl_client_get_storage(curl->handle);
 
                if (storage->cookiestore) {
                        pefree(storage->cookiestore, 1);
@@ -1092,7 +1092,7 @@ static STATUS php_http_curl_client_reset(php_http_client_t *h)
        CURL *ch = curl->handle;
        php_http_curl_client_storage_t *st;
 
-       if ((st = get_storage(ch))) {
+       if ((st = php_http_curl_client_get_storage(ch))) {
                if (st->url) {
                        pefree(st->url, 1);
                        st->url = NULL;
@@ -1139,7 +1139,7 @@ PHP_HTTP_API STATUS php_http_curl_client_prepare(php_http_client_t *h, php_http_
 {
        size_t body_size;
        php_http_curl_client_t *curl = h->ctx;
-       php_http_curl_client_storage_t *storage = get_storage(curl->handle);
+       php_http_curl_client_storage_t *storage = php_http_curl_client_get_storage(curl->handle);
        TSRMLS_FETCH_FROM_CTX(h->ts);
 
        /* request url */
@@ -1231,7 +1231,7 @@ static STATUS php_http_curl_client_exec(php_http_client_t *h, php_http_message_t
        uint tries = 0;
        CURLcode result;
        php_http_curl_client_t *curl = h->ctx;
-       php_http_curl_client_storage_t *storage = get_storage(curl->handle);
+       php_http_curl_client_storage_t *storage = php_http_curl_client_get_storage(curl->handle);
        TSRMLS_FETCH_FROM_CTX(h->ts);
 
        if (SUCCESS != php_http_curl_client_prepare(h, msg)) {
@@ -1299,7 +1299,7 @@ static STATUS php_http_curl_client_setopt(php_http_client_t *h, php_http_client_
 
                case PHP_HTTP_CLIENT_OPT_COOKIES_ENABLE:
                        /* are cookies already enabled anyway? */
-                       if (!get_storage(curl->handle)->cookiestore) {
+                       if (!php_http_curl_client_get_storage(curl->handle)->cookiestore) {
                                if (CURLE_OK != curl_easy_setopt(curl->handle, CURLOPT_COOKIEFILE, "")) {
                                        return FAILURE;
                                }
index 64aacf072f42a282b3d3053f3a4efe2b6a9d2e89..ae2a0b817ab94db5211f6ca9ad57c734df16d3ae 100644 (file)
@@ -49,7 +49,7 @@ typedef struct php_http_curl_client_storage {
        char errorbuffer[0x100];
 } php_http_curl_client_storage_t;
 
-static inline php_http_curl_client_storage_t *get_storage(CURL *ch) {
+static inline php_http_curl_client_storage_t *php_http_curl_client_get_storage(CURL *ch) {
        php_http_curl_client_storage_t *st = NULL;
 
        curl_easy_getinfo(ch, CURLINFO_PRIVATE, &st);