cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Socket options for data socket with active FTP

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 24 Jun 2012 22:37:22 +0200 (CEST)

On Sun, 24 Jun 2012, Gokhan Sengun wrote:

> Sorry, my previous answer was wrong. For an active FTP conn, given the fact
> that the socket is created by the 'accept' call, curl does not call the
> open/close-socket or sockopt callbacks.
>
> Maybe we can think about an informative callback -- set with a new option
> CURL_ACCEPTSOCKETFUNCTION to inform application if 'accept' creates a socket
> for the data connection?
>
> It looks to be a good idea.
>
> @Daniel:
>
> What do you think about it?

If you want a replacement for accept() then I think such a callback makes
sense. If you want to just do a setsockopt() on the new socket then I think
the CURL_SOCKOPTFUNCTION is the correct callback and it allows fairly easy
extension with its 'purpose' option. I certainly wouldn't mind seeing that it
gets used after accept() has returned successfully.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-06-24