Author: rhuijben
Date: Thu Oct 22 00:05:05 2015
New Revision: 1709936
URL: http://svn.apache.org/viewvc?rev=1709936&view=rev
Log:
Tweak configuration update on connect, to work only when connected to fix
collecting the local ip adress on platforms that don't deliver these until
after connect (such as Windows).
* outgoing.c
(connect_connection) Initialize ip addresses here and log that we
connected.
(serf__open_connections): Remove init here.
* serf_private.h
(serf_connection_t): Tweak comment.
Modified:
serf/trunk/outgoing.c
serf/trunk/serf_private.h
Modified: serf/trunk/outgoing.c
URL:
http://svn.apache.org/viewvc/serf/trunk/outgoing.c?rev=1709936&r1=1709935&r2=1709936&view=diff
==============================================================================
--- serf/trunk/outgoing.c (original)
+++ serf/trunk/outgoing.c Thu Oct 22 00:05:05 2015
@@ -375,6 +375,11 @@ static apr_status_t connect_connection(s
serf_context_t *ctx = conn->ctx;
apr_status_t status;
+ store_ipaddresses_in_config(conn->config, conn->skt);
+
+ serf__log(LOGLVL_DEBUG, LOGCOMP_CONN, __FILE__, conn->config,
+ "socket for conn 0x%x connected\n", conn);
+
/* If the authentication was already started on another connection,
prepare this connection (it might be possible to skip some
part of the handshaking). */
@@ -461,10 +466,6 @@ apr_status_t serf__open_connections(serf
* return immediately.
*/
status = apr_socket_connect(skt, conn->address);
- store_ipaddresses_in_config(conn->config, skt);
-
- serf__log(LOGLVL_DEBUG, LOGCOMP_CONN, __FILE__, conn->config,
- "connected socket for conn 0x%x, status %d\n", conn, status);
if (status != APR_SUCCESS) {
if (!APR_STATUS_IS_EINPROGRESS(status))
return status;
Modified: serf/trunk/serf_private.h
URL:
http://svn.apache.org/viewvc/serf/trunk/serf_private.h?rev=1709936&r1=1709935&r2=1709936&view=diff
==============================================================================
--- serf/trunk/serf_private.h (original)
+++ serf/trunk/serf_private.h Thu Oct 22 00:05:05 2015
@@ -408,7 +408,8 @@ struct serf_connection_t {
/* Write out information now */
int write_now;
- /* Wait for connect: connect() returned APR_EAGAIN. Socket not usable yet
*/
+ /* Wait for connect: connect() returned APR_EINPROGRESS.
+ Socket not usable yet */
int wait_for_connect;
/* Event callbacks, called from serf__process_connection() to do the actual