Commit 77354575 authored by Rusty Russell's avatar Rusty Russell

net: don't return still-connecting fd.

If one connect failed, we'd return the other one without
waiting for the connect to complete.  This resulted in
read() returning 0, which was really weird.

The downside: the poll doesn't seem to time out when the
connect times out (Linux 3.13 x86-64).
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent ebc67c3f
......@@ -159,6 +159,9 @@ int net_connect_complete(struct pollfd pfds[2])
}
continue;
}
if (!(pfds[i].revents & POLLOUT))
continue;
if (getsockopt(pfds[i].fd, SOL_SOCKET, SO_ERROR, &err,
&errlen) != 0) {
net_connect_abort(pfds);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment