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

verboseconnect: so the verbose checking within the function

As the function is used more than once and libcurl can be built
without it, do the conditional check within the verboseconnect()
function itself.
parent aca0fff4
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -154,7 +154,6 @@ static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke);
#define verboseconnect(x)  do { } while (0)
#define verboseconnect(x)  do { } while (0)
#endif
#endif



/*
/*
 * Protocol table.
 * Protocol table.
 */
 */
@@ -3181,6 +3180,7 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
#ifndef CURL_DISABLE_VERBOSE_STRINGS
#ifndef CURL_DISABLE_VERBOSE_STRINGS
static void verboseconnect(struct connectdata *conn)
static void verboseconnect(struct connectdata *conn)
{
{
  if(conn->data->set.verbose)
    infof(conn->data, "Connected to %s (%s) port %ld (#%ld)\n",
    infof(conn->data, "Connected to %s (%s) port %ld (#%ld)\n",
          conn->bits.proxy ? conn->proxy.dispname : conn->host.dispname,
          conn->bits.proxy ? conn->proxy.dispname : conn->host.dispname,
          conn->ip_addr_str, conn->port, conn->connectindex);
          conn->ip_addr_str, conn->port, conn->connectindex);
@@ -3275,7 +3275,6 @@ CURLcode Curl_protocol_connect(struct connectdata *conn,


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


    if(data->set.verbose)
    verboseconnect(conn);
    verboseconnect(conn);
  }
  }


@@ -4998,7 +4997,6 @@ static CURLcode setup_conn(struct connectdata *conn,
      Curl_pgrsTime(data, TIMER_APPCONNECT); /* we're connected already */
      Curl_pgrsTime(data, TIMER_APPCONNECT); /* we're connected already */
      conn->bits.tcpconnect = TRUE;
      conn->bits.tcpconnect = TRUE;
      *protocol_done = TRUE;
      *protocol_done = TRUE;
      if(data->set.verbose)
      verboseconnect(conn);
      verboseconnect(conn);
    }
    }
    /* Stop the loop now */
    /* Stop the loop now */