curl-library
Re: Socket options for data socket with active FTP
Date: Mon, 25 Jun 2012 02:10:10 +0300
>
> "replacement for accept()" sounds like a good idea but in the second
>> thought, I do not find any use case in which an application would need to
>> implement this callback. On the other hand, applications may need to set
>> socket options before data transfer kicks off. I am going to prepare a
>> patch for CURL_SOCKOPTFUNCTION after accept() gets called and returned
>> success.
>>
>>
> Attached is the patch providing the functionality.
>
>
I introduced a bug while providing the functionality. My first patch breaks
Curl_closesocket function. sock_accepted flag for the second socket should
be tagged as TRUE before the sockopt callback is called because in case the
callback returns an error, Curl_closesocket function is going to call the -
fclosesocket - callback for the accept()ed socket.
I am attaching both patches.
Thanks
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- application/octet-stream attachment: 0001-ftp-active-conn-allow-application-to-set-sockopt-aft.patch
- application/octet-stream attachment: 0002-ftp-active-conn-place-calling-sockopt-callback-at-th.patch