On Fri, 19 Aug 2011, amit paliwal wrote:
In this case what will be the solution? I need to do initial step manually because of some requirements and then I want CURL to takeover and do HTTP POST send and HTTP OK receive for me. I wana connect to server and then I want Curl to send and receive HTTP on same socket.
I can only think of one working approach. I trust you notice that your requirements are a bit unusual so the solution has to be rather un-libcurlish.
Create the socket yourself, connect to the server yourself, do your magic on the socket and then when you create the libcurl easy handle you set the CURLOPT_OPENSOCKETFUNCTION and CURLOPT_SOCKOPTFUNCTION options to hand over the socket and tell libcurl it already is connected.
Of course, a fun trick would be to do the first part with libcurl using CONNECT_ONLY and then before closing that easy handle, you pass that socket on to a second easy handle using the above mentioned options.
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
