Debugging output at the same time in case of asynchronous handling.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
goto success;
}
+ DBG("Asynchronous connect for sock %d, performing polling with"
+ " timeout: %lums", sock->fd, timeout);
/*
* Perform poll loop following EINPROGRESS recommendation from
* connect(2) man page.
ret = getsockopt(sock->fd, SOL_SOCKET,
SO_ERROR, &optval, &optval_len);
if (ret) {
+ PERROR("getsockopt");
goto error;
}
if (!optval) {
connect_ret = 0;
goto success;
} else {
+ /* Get actual connect() errno from opt_val */
+ errno = optval;
goto error;
}
}
goto success;
}
+ DBG("Asynchronous connect for sock %d, performing polling with"
+ " timeout: %lums", sock->fd, timeout);
+
/*
* Perform poll loop following EINPROGRESS recommendation from
* connect(2) man page.
ret = getsockopt(sock->fd, SOL_SOCKET,
SO_ERROR, &optval, &optval_len);
if (ret) {
+ PERROR("getsockopt");
goto error;
}
if (!optval) {
connect_ret = 0;
goto success;
} else {
+ /* Get actual connect() errno from opt_val */
+ errno = optval;
goto error;
}
}