Commit adaf8753 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

multi interface: missed storing connection time

Dirk Manske reported a regression. When connecting with the multi
interface, there were situations where libcurl wouldn't store
connect time correctly as it used to (and is documented to) do.

Using his fine sample program we could repeat it, and I wrote up
test case 573 using that code. The problem does not easily show
itself using the local test suite though.

The fix, also as suggested by Dirk, is a bit on the ugly side as
it adds yet another call to Curl_verboseconnect() and setting the
TIMER_CONNECT time.  That situation is subject for some closer
inspection in the future.
parent 89148570
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -7,6 +7,18 @@
                                  Changelog

Daniel Stenberg (7 May 2010)
- Dirk Manske reported a regression. When connecting with the multi interface,
  there were situations where libcurl wouldn't store connect time correctly as
  it used to (and is documented to) do.

  Using his fine sample program we could repeat it, and I wrote up test case
  573 using that code. The problem does not easily show itself using the local
  test suite though.

  The fix, also as suggested by Dirk, is a bit on the ugly side as it adds yet
  another call to Curl_verboseconnect() and setting the TIMER_CONNECT time.
  That situation is subject for some closer inspection in the future.

- Howard Chu split the I/O handling functions into private handlers.
    
  Howard Chu brought the bulk work of this patch that properly moves out the
+2 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ This release includes the following bugfixes:
 o MSVC makefiles now use ws2_32.lib instead of wsock32.lib
 o -O crash on windows
 o SSL handshake timeout underflow in libcurl-NSS
 o multi interface missed storing connection time

This release includes the following known bugs:

@@ -33,6 +34,6 @@ This release would not have looked like this without help, code, reports and
advice from friends like these:

 Rainer Canavan, Paul Howarth, Jerome Vouillon, Ruslan Gazizov, Yang Tse,
 Kamil Dudka, Alex Bligh, Ben Greear, Hoi-Ho Chan, Howard Chu
 Kamil Dudka, Alex Bligh, Ben Greear, Hoi-Ho Chan, Howard Chu, Dirk Manske

        Thanks! (and sorry if I forgot to mention someone)
+2 −0
Original line number Diff line number Diff line
@@ -575,6 +575,8 @@ CURLcode Curl_is_connected(struct connectdata *conn,
      /* we are connected, awesome! */
      conn->bits.tcpconnect = TRUE;
      *connected = TRUE;
      Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */
      Curl_verboseconnect(conn);
      return CURLE_OK;
    }
    /* nope, not connected for real */
+3 −8
Original line number Diff line number Diff line
@@ -150,10 +150,6 @@ static long ConnectionKillOne(struct SessionHandle *data);
static void conn_free(struct connectdata *conn);
static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke);

#ifdef CURL_DISABLE_VERBOSE_STRINGS
#define verboseconnect(x)  do { } while (0)
#endif

/*
 * Protocol table.
 */
@@ -3178,7 +3174,7 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
 * verboseconnect() displays verbose information after a connect
 */
#ifndef CURL_DISABLE_VERBOSE_STRINGS
static void verboseconnect(struct connectdata *conn)
void Curl_verboseconnect(struct connectdata *conn)
{
  if(conn->data->set.verbose)
    infof(conn->data, "Connected to %s (%s) port %ld (#%ld)\n",
@@ -3274,8 +3270,7 @@ CURLcode Curl_protocol_connect(struct connectdata *conn,
  if(!conn->bits.tcpconnect) {

    Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */

    verboseconnect(conn);
    Curl_verboseconnect(conn);
  }

  if(!conn->bits.protoconnstart) {
@@ -4997,7 +4992,7 @@ static CURLcode setup_conn(struct connectdata *conn,
      Curl_pgrsTime(data, TIMER_APPCONNECT); /* we're connected already */
      conn->bits.tcpconnect = TRUE;
      *protocol_done = TRUE;
      verboseconnect(conn);
      Curl_verboseconnect(conn);
    }
    /* Stop the loop now */
    break;
+8 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
@@ -86,4 +86,11 @@ void Curl_reset_reqproto(struct connectdata *conn);

CURLcode Curl_connected_proxy(struct connectdata *conn);

#ifdef CURL_DISABLE_VERBOSE_STRINGS
#define Curl_verboseconnect(x)  do { } while (0)
#else
void Curl_verboseconnect(struct connectdata *conn);
#endif


#endif
Loading