- /* perform request */
- if (CURLE_OK == (result = curl_easy_perform(ch))) {
- /* get curl info */
- if (info) {
- zval array;
- Z_ARRVAL(array) = info;
-
- HTTP_CURL_INFO(EFFECTIVE_URL);
-#if LIBCURL_VERSION_NUM >= 0x070a07
- HTTP_CURL_INFO(RESPONSE_CODE);
-#else
- HTTP_CURL_INFO_EX(HTTP_CODE, RESPONSE_CODE);
-#endif
- HTTP_CURL_INFO(HTTP_CONNECTCODE);
-#if LIBCURL_VERSION_NUM >= 0x070500
- HTTP_CURL_INFO(FILETIME);
-#endif
- HTTP_CURL_INFO(TOTAL_TIME);
- HTTP_CURL_INFO(NAMELOOKUP_TIME);
- HTTP_CURL_INFO(CONNECT_TIME);
- HTTP_CURL_INFO(PRETRANSFER_TIME);
- HTTP_CURL_INFO(STARTTRANSFER_TIME);
-#if LIBCURL_VERSION_NUM >= 0x070907
- HTTP_CURL_INFO(REDIRECT_TIME);
- HTTP_CURL_INFO(REDIRECT_COUNT);
-#endif
- HTTP_CURL_INFO(SIZE_UPLOAD);
- HTTP_CURL_INFO(SIZE_DOWNLOAD);
- HTTP_CURL_INFO(SPEED_DOWNLOAD);
- HTTP_CURL_INFO(SPEED_UPLOAD);
- HTTP_CURL_INFO(HEADER_SIZE);
- HTTP_CURL_INFO(REQUEST_SIZE);
- HTTP_CURL_INFO(SSL_VERIFYRESULT);
-#if LIBCURL_VERSION_NUM >= 0x070c03
- /*HTTP_CURL_INFO(SSL_ENGINES); todo: CURLINFO_SLIST */
-#endif
- HTTP_CURL_INFO(CONTENT_LENGTH_DOWNLOAD);
- HTTP_CURL_INFO(CONTENT_LENGTH_UPLOAD);
- HTTP_CURL_INFO(CONTENT_TYPE);
-#if LIBCURL_VERSION_NUM >= 0x070a03
- /*HTTP_CURL_INFO(PRIVATE);*/
-#endif
-#if LIBCURL_VERSION_NUM >= 0x070a08
- HTTP_CURL_INFO(HTTPAUTH_AVAIL);
- HTTP_CURL_INFO(PROXYAUTH_AVAIL);
-#endif
-#if LIBCURL_VERSION_NUM >= 0x070c02
- /*HTTP_CURL_INFO(OS_ERRNO);*/
-#endif
-#if LIBCURL_VERSION_NUM >= 0x070c03
- HTTP_CURL_INFO(NUM_CONNECTS);
-#endif
- }
- } else {
- http_error_ex(E_WARNING, HTTP_E_CURL, "Could not perform request: %s", curl_easy_strerror(result));
- status = FAILURE;
- }
-
-http_request_end:
- /* free strings copied with http_curl_copystr() */
- zend_llist_clean(&HTTP_G(request).curl.copies);
-
- /* clean curl handle if acquired */
- if (clean_curl) {
- curl_easy_cleanup(ch);
- ch = NULL;
- }