From c715fa0b60c86449e09b313245de621b32e329d2 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Fri, 27 Feb 2015 20:48:38 +0000 Subject: 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. --- src/tool_cb_wrt.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/tool_cb_wrt.c') 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, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , 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; } - -- cgit v1.2.3