]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_cfgable: make 'synthetic_error' a plain bool
authorDaniel Stenberg <daniel@haxx.se>
Wed, 20 Jul 2022 21:53:34 +0000 (23:53 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 23 Jul 2022 11:39:20 +0000 (13:39 +0200)
The specific reason was not used.

Closes #9179

src/tool_cb_wrt.c
src/tool_cfgable.h

index f943889aeed2c943d530ad0a90acc36126a2f77a..c9d1dbd1d2809e2930a9eb90a886bc16f24f19f2 100644 (file)
@@ -234,7 +234,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
       warnf(config->global, "Binary output can mess up your terminal. "
             "Use \"--output -\" to tell curl to output it to your terminal "
             "anyway, or consider \"--output <FILE>\" to save to a file.\n");
-      config->synthetic_error = ERR_BINARY_TERMINAL;
+      config->synthetic_error = TRUE;
       return failure;
     }
   }
index 9c44f7b4e95489253c0fc6cb965160225cd0b8d8..ec26eebf60c75d33f52391fe79a1adf43ddf3dae 100644 (file)
 #include "tool_urlglob.h"
 #include "tool_formparse.h"
 
-typedef enum {
-  ERR_NONE,
-  ERR_BINARY_TERMINAL = 1, /* binary to terminal detected */
-  ERR_LAST
-} curl_error;
-
 struct GlobalConfig;
 
 struct State {
@@ -282,8 +276,7 @@ struct OperationConfig {
   double expect100timeout;
   bool suppress_connect_headers;  /* suppress proxy CONNECT response headers
                                      from user callbacks */
-  curl_error synthetic_error;     /* if non-zero, it overrides any libcurl
-                                     error */
+  bool synthetic_error;           /* if TRUE, this is tool-internal error */
   bool ssh_compression;           /* enable/disable SSH compression */
   long happy_eyeballs_timeout_ms; /* happy eyeballs timeout in milliseconds.
                                      0 is valid. default: CURL_HET_DEFAULT. */