curl-library
CURLINFO_LASTSOCKET always return -1 with Https url (libcurl 7.15.4, openssl-0.9.8b)
Date: Fri, 07 Jul 2006 01:49:53 -0700
I am trying to use the CURLINFO_LASTSOCKET for getting the last socket
This code is working fine if I use the http://mail.yahoo.com (HTTP Server)
Once I start using the https://mail.yahoo.com (Https Server) it always
returns -1
Am I missing something here !
Thanks
Ratna Gudlavalleti
#include <fcntl.h>
#include <io.h>
#include <curl/curl.h>
int main(void) {
CURL *curl;
CURLcode res;
long last_sock=0;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://mail.yahoo.com/");
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1);
res = curl_easy_perform(curl);
res = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &last_sock);
printf("Return code frm curl_easy_getinfo [%d][%s]\n", res,
curl_easy_strerror(res));
printf("curl_easy_getinfo returned CURLINFO_LASTSOCKET [%ld]\n",
last_sock);
if(CURLE_OK == res) {
printf("curl_easy_getinfo returned CURLINFO_LASTSOCKET
[%ld]\n", last_sock);
}
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
Received on 2006-07-07