]> 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)
commitf6e62054b50421dc41a3a2a3734dd3f656ac1b7c
tree869244971263f9cd4426b0428f1505bf77030a32
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.

To handle this case, we have the active side follow the same
rule as the server side and defer establishing the rsocket
connection until the user calls the first data transfer routine.

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