cURL / Mailing Lists / curl-library / Single Mail

curl-library

ssl and socket reuse

From: <Sudeep_Das_at_mcafee.com>
Date: Tue, 8 Nov 2011 23:59:23 -0800

I know I could , maybe should have done my research and come out with an answer myself...just thought it would be good if someone can answer this off the top of his head.
So the situation is that we have a https client server stuff running with multiple requests responses...something like this

Do_request_response()
{
                Curl_easy_init();
                Curl_easy_setopt(); //bunch of them
                Curl_easy_perform();
Curl_easy_cleanup();
}

Do_server_communication()
{
                Do_request_response();
                ...
                ...
                //bunch of processing
                Do_request_response();
                ...
...
                Do_request_response();
}

The effect of this is that I end up

a. Opening up a fresh ssl connection for each request response

b. Not reusing session ids

The server folks are unhappy over this and want me to revamp the communication to

a. Use the same open descriptor for the entire do_server_communication() : I should be able to achieve this moving the init and cleanup calls to do_Server_communication(), and use the same handle for multiple calls to do_request_response()

b. Reuse the session ids across multiple invocations of do_server_communication() : Looks like this cant happen across multiple easy handles...Is there anyway I can achieve it ?

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-09