Re: [Patch] libfetch - closing the cached FTP connection

From: Mark Johnston <markjdb_at_gmail.com>
Date: Fri, 5 Nov 2010 11:20:09 -0400
On Fri, Nov 05, 2010 at 09:38:24AM +0100, Nick Hibma wrote:
> Mark,
> 
> My 2 cents: Isn't it more appropriate to set FD_CLOEXEC on the fd?
> 
> 	fcntl(fd, F_SETFD, FD_CLOEXEC); 
> 
> It doesn't sound like you ever want to have a cached connection be copied into the child. Mum and child calling daddy using the same phone line isn't going to make the conversation any easier for daddy.
> 
> Cheers,
> 
> Nick

The problem is that libfetch's ftp functions use an interface set up by
funopen(3), so functions like fetchGetURL return a FILE*. However, I
can't use something like fileno(3) to get the descriptor to pass to
fcntl, because libfetch's FILE * is actually a struct ftpio *, which is
only in ftp.c, i.e. not in the headers.

I think using fcntl is nicer than having a "close the cached connection"
function, but I don't think I can get around this problem without
changing something in libfetch.

Thanks,
-Mark
Received on Fri Nov 05 2010 - 14:20:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:08 UTC