failf(data, "Insufficient kernel memory was available: %d", errno);
break;
default:
- failf(data, "errno %d\n", errno);
+ failf(data, "errno %d", errno);
break;
} /* end of switch(errno) */
}
if ((word == NULL) || (*word == (char)0)) {
- failf(data, "lookup word is missing\n");
+ failf(data, "lookup word is missing");
}
if ((database == NULL) || (*database == (char)0)) {
database = (char *)"!";
}
if ((word == NULL) || (*word == (char)0)) {
- failf(data, "lookup word is missing\n");
+ failf(data, "lookup word is missing");
}
if ((database == NULL) || (*database == (char)0)) {
database = (char *)"!";
passed += actuallyread;
if(actuallyread != readthisamountnow) {
- failf(data, "Could only read %d bytes from the input\n", passed);
+ failf(data, "Could only read %d bytes from the input", passed);
return CURLE_FTP_COULDNT_USE_REST;
}
}
if(0 == (http->readbytecount + conn->headerbytecount)) {
/* nothing was read from the HTTP server, this can't be right
so we return an error here */
- failf(data, "Empty reply from server\n");
+ failf(data, "Empty reply from server");
return CURLE_GOT_NOTHING;
}
passed += actuallyread;
if(actuallyread != readthisamountnow) {
- failf(data, "Could only read %d bytes from the input\n",
+ failf(data, "Could only read %d bytes from the input",
passed);
return CURLE_READ_ERROR;
}
data->set.infilesize -= conn->resume_from;
if(data->set.infilesize <= 0) {
- failf(data, "File already completely uploaded\n");
+ failf(data, "File already completely uploaded");
return CURLE_PARTIAL_FILE;
}
}
char contentType[256];
int linelength=0;
if(Curl_FormInit(&http->form, http->sendit)) {
- failf(data, "Internal HTTP POST error!\n");
+ failf(data, "Internal HTTP POST error!");
return CURLE_HTTP_POST_ERROR;
}
1,
(FILE *)&http->form);
if(linelength == -1) {
- failf(data, "Could not get Content-Type header line!\n");
+ failf(data, "Could not get Content-Type header line!");
return CURLE_HTTP_POST_ERROR;
}
add_buffer(req_buffer, contentType, linelength);
memset(schedule, 0, sizeof(schedule));
memset(passwd, 0, sizeof(passwd));
if(Curl_base64_encode(tktcopy.dat, tktcopy.length, &p) < 0) {
- failf(conn->data, "Out of memory base64-encoding.\n");
+ failf(conn->data, "Out of memory base64-encoding.");
Curl_set_command_prot(conn, save);
return;
}
conn);
free(buf);
if(len < 0) {
- failf(conn->data, "Failed to encode command.\n");
+ failf(conn->data, "Failed to encode command.");
return -1;
}
if(Curl_base64_encode(enc, len, &buf) < 0){
- failf(conn->data, "Out of memory base64-encoding.\n");
+ failf(conn->data, "Out of memory base64-encoding.");
return -1;
}
if(conn->command_prot == prot_safe)
return -1;
if(conn->data->state.buffer[0] != '2'){
- failf(conn->data, "Failed to set protection buffer size.\n");
+ failf(conn->data, "Failed to set protection buffer size.");
return -1;
}
conn->buffer_size = s;
return -1;
if(conn->data->state.buffer[0] != '2'){
- failf(conn->data, "Failed to set protection level.\n");
+ failf(conn->data, "Failed to set protection level.");
return -1;
}
}
}
-/* Curl_failf() is for messages stating why we failed, the LAST one will be
- returned for the user (if requested) */
+/* Curl_failf() is for messages stating why we failed.
+ * The message SHALL NOT include any LF or CR.
+ */
void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
{
if (SSL_CTX_use_certificate_file(conn->ssl.ctx,
cert_file,
SSL_FILETYPE_PEM) != 1) {
- failf(data, "unable to set certificate file (wrong password?)\n");
+ failf(data, "unable to set certificate file (wrong password?)");
return(0);
}
if (key_file == NULL)
if (SSL_CTX_use_PrivateKey_file(conn->ssl.ctx,
key_file,
SSL_FILETYPE_PEM) != 1) {
- failf(data, "unable to set public key file\n");
+ failf(data, "unable to set public key file");
return(0);
}
/* Now we know that a key and cert have been set against
* the SSL context */
if (!SSL_CTX_check_private_key(conn->ssl.ctx)) {
- failf(data, "Private key does not match the certificate public key\n");
+ failf(data, "Private key does not match the certificate public key");
return(0);
}
#ifndef HAVE_USERDATA_IN_PWD_CALLBACK
if(data->set.ssl.cipher_list) {
if (!SSL_CTX_set_cipher_list(conn->ssl.ctx,
data->set.ssl.cipher_list)) {
- failf(data, "failed setting cipher list\n");
+ failf(data, "failed setting cipher list");
return CURLE_SSL_CONNECT_ERROR;
}
}
if (!SSL_CTX_load_verify_locations(conn->ssl.ctx,
data->set.ssl.CAfile,
data->set.ssl.CApath)) {
- failf(data,"error setting cerficate verify locations\n");
+ failf(data,"error setting cerficate verify locations");
return CURLE_SSL_CONNECT_ERROR;
}
}
if(data->set.ssl.verifypeer) {
data->set.ssl.certverifyresult=SSL_get_verify_result(conn->ssl.handle);
if (data->set.ssl.certverifyresult != X509_V_OK) {
- failf(data, "SSL certificate verify result: %d\n",
+ failf(data, "SSL certificate verify result: %d",
data->set.ssl.certverifyresult);
retcode = CURLE_SSL_PEER_CERTIFICATE;
}