On Fri, Aug 19, 2011 at 10:33 AM, Daniel Stenberg <[email protected]> wrote:
> 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. > ----I am aware of it and this is why I am trying to do it this way. > > 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. > ----So is it like all this shall happen before the easy handle is made > > 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. --- now this is what i tried and i failed, but i believe i did not pass the socket to the second easy handle. I thought if i will do it, then curl might try to connect to the server again and open another connection and i do not want this. how can i pass socket (where this socket is created by the option CONNECT_ONLY) to another easy handle and believe that curl will use the same socket which is still connected to the server and will not open another one. > > > -- > > / daniel.haxx.se > ------------------------------**------------------------------**------- > List admin: > http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library> > Etiquette: > http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html> > -- Regards, Amit
------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
