[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 03/73: failf: skip the sprintf() if there are no co
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 03/73: failf: skip the sprintf() if there are no consumers |
Date: |
Tue, 24 Oct 2017 18:53:44 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 120d963a64f121619d69d6590b2cba7783a7df2a
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Oct 3 14:26:36 2017 +0200
failf: skip the sprintf() if there are no consumers
Closes #1936
---
lib/sendf.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/lib/sendf.c b/lib/sendf.c
index 7564cb3d0..cbdb233fd 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -241,25 +241,25 @@ void Curl_infof(struct Curl_easy *data, const char *fmt,
...)
void Curl_failf(struct Curl_easy *data, const char *fmt, ...)
{
- va_list ap;
- size_t len;
- char error[CURL_ERROR_SIZE + 2];
- va_start(ap, fmt);
-
- vsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
- len = strlen(error);
+ if(data->set.verbose || data->set.errorbuffer) {
+ va_list ap;
+ size_t len;
+ char error[CURL_ERROR_SIZE + 2];
+ va_start(ap, fmt);
+ vsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
+ len = strlen(error);
- if(data->set.errorbuffer && !data->state.errorbuf) {
- strcpy(data->set.errorbuffer, error);
- data->state.errorbuf = TRUE; /* wrote error string */
- }
- if(data->set.verbose) {
- error[len] = '\n';
- error[++len] = '\0';
- Curl_debug(data, CURLINFO_TEXT, error, len, NULL);
+ if(data->set.errorbuffer && !data->state.errorbuf) {
+ strcpy(data->set.errorbuffer, error);
+ data->state.errorbuf = TRUE; /* wrote error string */
+ }
+ if(data->set.verbose) {
+ error[len] = '\n';
+ error[++len] = '\0';
+ Curl_debug(data, CURLINFO_TEXT, error, len, NULL);
+ }
+ va_end(ap);
}
-
- va_end(ap);
}
/* Curl_sendf() sends formatted data to the server */
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] branch master updated (dc0683b64 -> 8252aa305), gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 02/73: ftp: UBsan fixup 'pointer index expression overflowed', gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 10/73: openssl: fix build without HAVE_OPAQUE_EVP_PKEY, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 09/73: lib/config-win32.h: let SMB/SMBS be enabled with OpenSSL/NSS, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 08/73: build: fix --disable-crypto-auth, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 05/73: lib/Makefile.m32: allow customizing dll suffixes, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 07/73: darwinssl: add support for TLSv1.3, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 03/73: failf: skip the sprintf() if there are no consumers,
gnunet <=
- [GNUnet-SVN] [gnurl] 26/73: test643: verify curl_mime_subparts() rejects cyclic additions., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 35/73: test298: verify --ftp-method nowcwd with URL encoded path, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 20/73: mime: be tolerant about setting twice the same header list in a part., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 12/73: multi_cleanup: call DONE on handles that never got that, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 01/73: RELEASE-PROCEDURE: update the release schedule, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 14/73: tests: added flaky keyword to tests 587 and 644, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 33/73: CURLOPT_NOPROGRESS.3: also refer to xferinfofunction, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 24/73: mime: avoid resetting a part's encoder when part's contents change., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 48/73: mime: fix the content reader to handle >16K data properly, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 43/73: HELP-US: the label "PR-welcome" is now renamed to "help wanted", gnunet, 2017/10/24