diff options
author | Yang Tse <yangsita@gmail.com> | 2012-06-14 13:32:05 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2012-06-14 13:32:05 +0200 |
commit | 6085ca2aeddb38e4d5f24c47bd98111b236cf384 (patch) | |
tree | 7b4577a279969ef44ed811738ef80723367ca508 | |
parent | a8259945c4086445022b658f023bc712d1fc9c9d (diff) |
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.
-rw-r--r-- | lib/curl_schannel.c | 33 | ||||
-rw-r--r-- | lib/cyassl.c | 2 | ||||
-rw-r--r-- | lib/formdata.c | 4 | ||||
-rw-r--r-- | lib/gtls.c | 2 | ||||
-rw-r--r-- | lib/http.c | 2 | ||||
-rw-r--r-- | lib/polarssl.c | 5 | ||||
-rw-r--r-- | lib/socks_gssapi.c | 3 | ||||
-rw-r--r-- | lib/socks_sspi.c | 2 | ||||
-rw-r--r-- | lib/ssh.c | 2 | ||||
-rw-r--r-- | lib/ssluse.c | 10 |
10 files changed, 33 insertions, 32 deletions
diff --git a/lib/curl_schannel.c b/lib/curl_schannel.c index 71a3c57af..585583ae4 100644 --- a/lib/curl_schannel.c +++ b/lib/curl_schannel.c @@ -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 { diff --git a/lib/cyassl.c b/lib/cyassl.c index e552e475a..4c517802f 100644 --- a/lib/cyassl.c +++ b/lib/cyassl.c @@ -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]? diff --git a/lib/formdata.c b/lib/formdata.c index 5349130ff..7bf883941 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -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; } diff --git a/lib/gtls.c b/lib/gtls.c index e24e7a81e..f77bbc5fd 100644 --- a/lib/gtls.c +++ b/lib/gtls.c @@ -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; } diff --git a/lib/http.c b/lib/http.c index 2726165bf..4298b213a 100644 --- a/lib/http.c +++ b/lib/http.c @@ -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; diff --git a/lib/polarssl.c b/lib/polarssl.c index 39816baf0..a2f61d23d 100644 --- a/lib/polarssl.c +++ b/lib/polarssl.c @@ -6,6 +6,7 @@ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, 2011, Hoi-Ho Chan, <hoiho.chan@gmail.com> + * Copyright (C) 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 @@ -90,7 +91,7 @@ static void polarssl_debug(void *context, int level, char *line) data = (struct SessionHandle *)context; - infof(data, "%s", line); + infof(data, "%s\n", line); } #else #endif @@ -289,7 +290,7 @@ polarssl_connect_step2(struct connectdata *conn, if(ret && data->set.ssl.verifypeer) { if(ret & BADCERT_EXPIRED) - failf(data, "Cert verify failed: BADCERT_EXPIRED\n"); + failf(data, "Cert verify failed: BADCERT_EXPIRED"); if(ret & BADCERT_REVOKED) { failf(data, "Cert verify failed: BADCERT_REVOKED"); diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index d23a944d7..02dd485f1 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -6,6 +6,7 @@ * \___|\___/|_| \_\_____| * * Copyright (C) 2009, 2011, Markus Moeller, <markus_moeller@compuserve.com> + * Copyright (C) 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 @@ -102,7 +103,7 @@ static int check_gss_err(struct SessionHandle *data, } gss_release_buffer(&min_stat, &status_string); } - failf(data, "GSSAPI error: %s failed:\n%s\n", function, buf); + failf(data, "GSSAPI error: %s failed:\n%s", function, buf); return(1); } diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 0b86bbf21..61ef2f4a7 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -58,7 +58,7 @@ static int check_sspi_err(struct connectdata *conn, status != SEC_I_COMPLETE_AND_CONTINUE && status != SEC_I_COMPLETE_NEEDED && status != SEC_I_CONTINUE_NEEDED) { - failf(conn->data, "SSPI error: %s failed: %s\n", function, + failf(conn->data, "SSPI error: %s failed: %s", function, Curl_sspi_strerror(conn, status)); return 1; } @@ -2540,7 +2540,7 @@ static CURLcode ssh_easy_statemach(struct connectdata *conn, left = Curl_timeleft(data, NULL, duringconnect); if(left < 0) { - failf(data, "Operation timed out\n"); + failf(data, "Operation timed out"); return CURLE_OPERATION_TIMEDOUT; } diff --git a/lib/ssluse.c b/lib/ssluse.c index 7ca466663..7a9f3e084 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -1653,7 +1653,7 @@ ossl_connect_step1(struct connectdata *conn, if(data->set.ssl.verifypeer) { /* Fail if we insist 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]? @@ -1688,7 +1688,7 @@ ossl_connect_step1(struct connectdata *conn, if(!lookup || (!X509_load_crl_file(lookup,data->set.str[STRING_SSL_CRLFILE], X509_FILETYPE_PEM)) ) { - failf(data,"error loading CRL file: %s\n", + failf(data,"error loading CRL file: %s", data->set.str[STRING_SSL_CRLFILE]); return CURLE_SSL_CRL_BADFILE; } @@ -2346,7 +2346,7 @@ static CURLcode servercert(struct connectdata *conn, fp=fopen(data->set.str[STRING_SSL_ISSUERCERT],"r"); if(!fp) { if(strict) - failf(data, "SSL: Unable to open issuer cert (%s)\n", + failf(data, "SSL: Unable to open issuer cert (%s)", data->set.str[STRING_SSL_ISSUERCERT]); X509_free(connssl->server_cert); connssl->server_cert = NULL; @@ -2355,7 +2355,7 @@ static CURLcode servercert(struct connectdata *conn, issuer = PEM_read_X509(fp,NULL,ZERO_NULL,NULL); if(!issuer) { if(strict) - failf(data, "SSL: Unable to read issuer cert (%s)\n", + failf(data, "SSL: Unable to read issuer cert (%s)", data->set.str[STRING_SSL_ISSUERCERT]); X509_free(connssl->server_cert); X509_free(issuer); @@ -2365,7 +2365,7 @@ static CURLcode servercert(struct connectdata *conn, fclose(fp); if(X509_check_issued(issuer,connssl->server_cert) != X509_V_OK) { if(strict) - failf(data, "SSL: Certificate issuer check failed (%s)\n", + failf(data, "SSL: Certificate issuer check failed (%s)", data->set.str[STRING_SSL_ISSUERCERT]); X509_free(connssl->server_cert); X509_free(issuer); |