Commit 6085ca2a authored by Yang Tse's avatar Yang Tse
Browse files

Fix bad failf() and info() usage

Calls to failf() are not supposed to provide trailing newline.
Calls to infof() must provide trailing newline.

Fixed 30 or so strings.
parent a8259945
Loading
Loading
Loading
Loading
+16 −17
Original line number Diff line number Diff line
@@ -163,10 +163,10 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)

    if(sspi_status != SEC_E_OK) {
      if(sspi_status == SEC_E_WRONG_PRINCIPAL)
        failf(data, "schannel: SNI or certificate check failed: %s\n",
        failf(data, "schannel: SNI or certificate check failed: %s",
              Curl_sspi_strerror(conn, sspi_status));
      else
        failf(data, "schannel: AcquireCredentialsHandleA failed: %s\n",
        failf(data, "schannel: AcquireCredentialsHandleA failed: %s",
              Curl_sspi_strerror(conn, sspi_status));
      free(connssl->cred);
      connssl->cred = NULL;
@@ -204,10 +204,10 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)

  if(sspi_status != SEC_I_CONTINUE_NEEDED) {
    if(sspi_status == SEC_E_WRONG_PRINCIPAL)
      failf(data, "schannel: SNI or certificate check failed: %s\n",
      failf(data, "schannel: SNI or certificate check failed: %s",
            Curl_sspi_strerror(conn, sspi_status));
    else
      failf(data, "schannel: initial InitializeSecurityContextA failed: %s\n",
      failf(data, "schannel: initial InitializeSecurityContextA failed: %s",
            Curl_sspi_strerror(conn, sspi_status));
    free(connssl->ctxt);
    connssl->ctxt = NULL;
@@ -221,7 +221,7 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
  written = swrite(conn->sock[sockindex], outbuf.pvBuffer, outbuf.cbBuffer);
  s_pSecFn->FreeContextBuffer(outbuf.pvBuffer);
  if(outbuf.cbBuffer != (size_t)written) {
    failf(data, "schannel: failed to send initial handshake data: %d\n",
    failf(data, "schannel: failed to send initial handshake data: %d",
          written);
    return CURLE_SSL_CONNECT_ERROR;
  }
@@ -276,8 +276,7 @@ schannel_connect_step2(struct connectdata *conn, int sockindex)
      return CURLE_OK;
    }
    else if(nread == 0) {
      failf(data, "schannel: failed to receive handshake, connection "
            "failed\n");
      failf(data, "schannel: failed to receive handshake, connection failed");
      return CURLE_SSL_CONNECT_ERROR;
    }
  }
@@ -347,7 +346,7 @@ schannel_connect_step2(struct connectdata *conn, int sockindex)
        written = swrite(conn->sock[sockindex],
                         outbuf[i].pvBuffer, outbuf[i].cbBuffer);
        if(outbuf[i].cbBuffer != (size_t)written) {
          failf(data, "schannel: failed to send next handshake data: %d\n",
          failf(data, "schannel: failed to send next handshake data: %d",
                written);
          return CURLE_SSL_CONNECT_ERROR;
        }
@@ -361,10 +360,10 @@ schannel_connect_step2(struct connectdata *conn, int sockindex)
  }
  else {
    if(sspi_status == SEC_E_WRONG_PRINCIPAL)
      failf(data, "schannel: SNI or certificate check failed: %s\n",
      failf(data, "schannel: SNI or certificate check failed: %s",
            Curl_sspi_strerror(conn, sspi_status));
    else
      failf(data, "schannel: next InitializeSecurityContextA failed: %s\n",
      failf(data, "schannel: next InitializeSecurityContextA failed: %s",
            Curl_sspi_strerror(conn, sspi_status));
    return CURLE_SSL_CONNECT_ERROR;
  }
@@ -419,17 +418,17 @@ schannel_connect_step3(struct connectdata *conn, int sockindex)
  /* check if the required context attributes are met */
  if(connssl->ret_flags != connssl->req_flags) {
    if(!(connssl->ret_flags & ISC_RET_SEQUENCE_DETECT))
      failf(data, "schannel: failed to setup sequence detection\n");
      failf(data, "schannel: failed to setup sequence detection");
    if(!(connssl->ret_flags & ISC_RET_REPLAY_DETECT))
      failf(data, "schannel: failed to setup replay detection\n");
      failf(data, "schannel: failed to setup replay detection");
    if(!(connssl->ret_flags & ISC_RET_CONFIDENTIALITY))
      failf(data, "schannel: failed to setup confidentiality\n");
      failf(data, "schannel: failed to setup confidentiality");
    if(!(connssl->ret_flags & ISC_RET_EXTENDED_ERROR))
      failf(data, "schannel: failed to setup extended errors\n");
      failf(data, "schannel: failed to setup extended errors");
    if(!(connssl->ret_flags & ISC_RET_ALLOCATED_MEMORY))
      failf(data, "schannel: failed to setup memory allocation\n");
      failf(data, "schannel: failed to setup memory allocation");
    if(!(connssl->ret_flags & ISC_RET_STREAM))
      failf(data, "schannel: failed to setup stream orientation\n");
      failf(data, "schannel: failed to setup stream orientation");
    return CURLE_SSL_CONNECT_ERROR;
  }

@@ -446,7 +445,7 @@ schannel_connect_step3(struct connectdata *conn, int sockindex)
    retcode = Curl_ssl_addsessionid(conn, (void*)connssl->cred,
                                    sizeof(struct curl_schannel_cred));
    if(retcode) {
      failf(data, "schannel: failed to store credential handle\n");
      failf(data, "schannel: failed to store credential handle");
      return retcode;
    }
    else {
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ cyassl_connect_step1(struct connectdata *conn,
      if(data->set.ssl.verifypeer) {
        /* Fail if we insiste on successfully verifying the server. */
        failf(data,"error setting certificate verify locations:\n"
              "  CAfile: %s\n  CApath: %s\n",
              "  CAfile: %s\n  CApath: %s",
              data->set.str[STRING_SSL_CAFILE]?
              data->set.str[STRING_SSL_CAFILE]: "none",
              data->set.str[STRING_SSL_CAPATH]?
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2012, 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
@@ -1239,7 +1239,7 @@ CURLcode Curl_getformdata(struct SessionHandle *data,
        }
        else {
          if(data)
            failf(data, "couldn't open file \"%s\"\n", file->contents);
            failf(data, "couldn't open file \"%s\"", file->contents);
          *finalform = NULL;
          result = CURLE_READ_ERROR;
        }
+1 −1
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ gtls_connect_step1(struct connectdata *conn,
                                              data->set.ssl.CRLfile,
                                              GNUTLS_X509_FMT_PEM);
    if(rc < 0) {
      failf(data, "error reading crl file %s (%s)\n",
      failf(data, "error reading crl file %s (%s)",
            data->set.ssl.CRLfile, gnutls_strerror(rc));
      return CURLE_SSL_CRL_BADFILE;
    }
+1 −1
Original line number Diff line number Diff line
@@ -1601,7 +1601,7 @@ CURLcode Curl_add_timecondition(struct SessionHandle *data,

  result = Curl_gmtime(data->set.timevalue, &keeptime);
  if(result) {
    failf(data, "Invalid TIMEVALUE\n");
    failf(data, "Invalid TIMEVALUE");
    return result;
  }
  tm = &keeptime;
Loading