mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
- Fixed bug #22312 (crash on failed connection when curl_getinfo() was called).
(Phil Oleson <poleson@verio.net>)
This commit is contained in:
parent
08b5f6b2b9
commit
535a73a71e
@ -1101,46 +1101,68 @@ PHP_FUNCTION(curl_getinfo)
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_URL, &s_code);
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_URL, &s_code) == CURLE_OK) {
|
||||
CAAS("url", s_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_TYPE, &s_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_TYPE, &s_code) == CURLE_OK) {
|
||||
if (s_code != NULL) {
|
||||
CAAS("content_type", s_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_HTTP_CODE, &l_code);
|
||||
}
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_HTTP_CODE, &l_code) == CURLE_OK) {
|
||||
CAAL("http_code", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_HEADER_SIZE, &l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_HEADER_SIZE, &l_code) == CURLE_OK) {
|
||||
CAAL("header_size", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_REQUEST_SIZE, &l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_REQUEST_SIZE, &l_code) == CURLE_OK) {
|
||||
CAAL("request_size", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_FILETIME, &l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_FILETIME, &l_code) == CURLE_OK) {
|
||||
CAAL("filetime", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SSL_VERIFYRESULT, &l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SSL_VERIFYRESULT, &l_code) == CURLE_OK) {
|
||||
CAAL("ssl_verify_result", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_COUNT, &l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_COUNT, &l_code) == CURLE_OK) {
|
||||
CAAL("redirect_count", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("total_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("namelookup_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("connect_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("pretransfer_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SIZE_UPLOAD, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_UPLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("size_upload", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SIZE_DOWNLOAD, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_DOWNLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("size_download", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SPEED_DOWNLOAD, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_DOWNLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("speed_download", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SPEED_UPLOAD, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_UPLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("speed_upload", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("download_content_length", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_UPLOAD, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_UPLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("upload_content_length", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_STARTTRANSFER_TIME, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_STARTTRANSFER_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("starttransfer_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_TIME, &d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("redirect_time", d_code);
|
||||
}
|
||||
} else {
|
||||
option = Z_LVAL_PP(zoption);
|
||||
switch (option) {
|
||||
|
Loading…
Reference in New Issue
Block a user