]> git.openfabrics.org - ~shefty/librdmacm.git/commit
rspreload: Do not block connect when supporting fork
authorSean Hefty <sean.hefty@intel.com>
Sat, 11 Aug 2012 04:44:39 +0000 (21:44 -0700)
committerSean Hefty <sean.hefty@intel.com>
Sat, 11 Aug 2012 04:44:39 +0000 (21:44 -0700)
commit1bd37069db8ad3555c9fd59b2bb956f95eba066e
tree3513087cec3ea33b2826cc40e6f7fcdcafbab00c
parentac51c1095f505373a6ec54b8f1d990259fb34d97
rspreload: Do not block connect when supporting fork

Many FTP servers require fork support.  However, FTP clients,
such as ncftp, will perform the following call sequence:

send PASV request to server over connection 1
         server will listen for connection 2
issue nonblocking connect to server
send ACCEPT request to server over connection 1
         server will accept connection 2

The current fork support converts all nonblocking connect
calls to blocking.  The result is that the FTP client ends up
blocked waiting for the server to accept the connection,
which it will never do.

Fix this by deferring the fork connection handling until the
first socket call after connect.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/preload.c