cURL / Mailing Lists / curl-library / Single Mail


Re: Socket options for data socket with active FTP

From: Gokhan Sengun <>
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.


List admin:

Received on 2012-06-25