summaryrefslogtreecommitdiff
path: root/src/tool_cb_wrt.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2015-02-27 20:48:38 +0000
committerSteve Holme <steve_holme@hotmail.com>2015-02-27 21:05:52 +0000
commitc715fa0b60c86449e09b313245de621b32e329d2 (patch)
tree9c17ebd6afa3ab7725feb02f2bd10f0d368cafbe /src/tool_cb_wrt.c
parentadf27bf60f9e4ce29ef5a6a553763737842629a1 (diff)
downloadgnurl-c715fa0b60c86449e09b313245de621b32e329d2.tar.gz
gnurl-c715fa0b60c86449e09b313245de621b32e329d2.tar.bz2
gnurl-c715fa0b60c86449e09b313245de621b32e329d2.zip
tool: Updated the warnf() function to use the GlobalConfig structure
As the 'error' and 'mute' options are now part of the GlobalConfig, rather than per Operation, updated the warnf() function to use this structure rather than the OperationConfig.
Diffstat (limited to 'src/tool_cb_wrt.c')
-rw-r--r--src/tool_cb_wrt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c
index dfbf95cc6..918391ad0 100644
--- a/src/tool_cb_wrt.c
+++ b/src/tool_cb_wrt.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2015, 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
@@ -55,13 +55,14 @@ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata)
#ifdef DEBUGBUILD
if(config->include_headers) {
if(sz * nmemb > (size_t)CURL_MAX_HTTP_HEADER) {
- warnf(config, "Header data size exceeds single call write limit!\n");
+ warnf(config->global, "Header data size exceeds single call write "
+ "limit!\n");
return failure;
}
}
else {
if(sz * nmemb > (size_t)CURL_MAX_WRITE_SIZE) {
- warnf(config, "Data size exceeds single call write limit!\n");
+ warnf(config->global, "Data size exceeds single call write limit!\n");
return failure;
}
}
@@ -90,7 +91,7 @@ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata)
check_fails = TRUE;
}
if(check_fails) {
- warnf(config, "Invalid output struct data for write callback\n");
+ warnf(config->global, "Invalid output struct data for write callback\n");
return failure;
}
}
@@ -100,7 +101,7 @@ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata)
FILE *file;
if(!outs->filename || !*outs->filename) {
- warnf(config, "Remote filename has no length!\n");
+ warnf(config->global, "Remote filename has no length!\n");
return failure;
}
@@ -109,7 +110,7 @@ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata)
file = fopen(outs->filename, "rb");
if(file) {
fclose(file);
- warnf(config, "Refusing to overwrite %s: %s\n", outs->filename,
+ warnf(config->global, "Refusing to overwrite %s: %s\n", outs->filename,
strerror(EEXIST));
return failure;
}
@@ -118,7 +119,7 @@ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata)
/* open file for writing */
file = fopen(outs->filename, "wb");
if(!file) {
- warnf(config, "Failed to create the file %s: %s\n", outs->filename,
+ warnf(config->global, "Failed to create the file %s: %s\n", outs->filename,
strerror(errno));
return failure;
}
@@ -149,4 +150,3 @@ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata)
return rc;
}
-