]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sendf: make Curl_debug a void function
authorDaniel Stenberg <daniel@haxx.se>
Wed, 20 Jul 2022 09:15:25 +0000 (11:15 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 23 Jul 2022 11:38:43 +0000 (13:38 +0200)
As virtually no called checked the return code, and those that did
wrongly treated it as a CURLcode. Detected by the icc compiler warning:
enumerated type mixed with another type

Closes #9179

lib/c-hyper.c
lib/http_proxy.c
lib/sendf.c
lib/sendf.h

index 93b912c47cf1a87234281b0e23c0583084fe34a5..b098b70792cd7096e67db42d82d005d20ffe4955 100644 (file)
@@ -1013,10 +1013,8 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
     /* For HTTP/2, we show the Host: header as if we sent it, to make it look
        like for HTTP/1 but it isn't actually sent since :authority is then
        used. */
-    result = Curl_debug(data, CURLINFO_HEADER_OUT, data->state.aptr.host,
-                        strlen(data->state.aptr.host));
-    if(result)
-      goto error;
+    Curl_debug(data, CURLINFO_HEADER_OUT, data->state.aptr.host,
+               strlen(data->state.aptr.host));
   }
 
   if(data->state.aptr.proxyuserpwd) {
@@ -1136,9 +1134,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
   if(result)
     goto error;
 
-  result = Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"\r\n", 2);
-  if(result)
-    goto error;
+  Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"\r\n", 2);
 
   data->req.upload_chunky = FALSE;
   sendtask = hyper_clientconn_send(client, req);
index a69cff2b3c1fae430fc6bf07ad526704c5442c9a..1f87f6c62aa4016595f0656192e6a66040c314d1 100644 (file)
@@ -393,8 +393,8 @@ static CURLcode CONNECT(struct Curl_easy *data,
 
         if(!result)
           /* send to debug callback! */
-          result = Curl_debug(data, CURLINFO_HEADER_OUT,
-                              k->upload_fromhere, bytes_written);
+          Curl_debug(data, CURLINFO_HEADER_OUT,
+                     k->upload_fromhere, bytes_written);
 
         s->nsend -= bytes_written;
         k->upload_fromhere += bytes_written;
index d19fb552331a30b09028407988bfb614b254d0ce..52788fd5fcefc6a6cfb1e79008ba017e16f66e29 100644 (file)
@@ -714,16 +714,15 @@ CURLcode Curl_read(struct Curl_easy *data,   /* transfer */
 }
 
 /* return 0 on success */
-int Curl_debug(struct Curl_easy *data, curl_infotype type,
-               char *ptr, size_t size)
+void Curl_debug(struct Curl_easy *data, curl_infotype type,
+                char *ptr, size_t size)
 {
-  int rc = 0;
   if(data->set.verbose) {
     static const char s_infotype[CURLINFO_END][3] = {
       "* ", "< ", "> ", "{ ", "} ", "{ ", "} " };
     if(data->set.fdebug) {
       Curl_set_in_callback(data, true);
-      rc = (*data->set.fdebug)(data, type, ptr, size, data->set.debugdata);
+      (void)(*data->set.fdebug)(data, type, ptr, size, data->set.debugdata);
       Curl_set_in_callback(data, false);
     }
     else {
@@ -739,5 +738,4 @@ int Curl_debug(struct Curl_easy *data, curl_infotype type,
       }
     }
   }
-  return rc;
 }
index 075d70eaadb014ec2dfaf2d3f4683aaa84941e56..7c4c1280a0746de4611eb84c18c4f1b3a98d9de0 100644 (file)
@@ -89,8 +89,8 @@ CURLcode Curl_write_plain(struct Curl_easy *data,
                           ssize_t *written);
 
 /* the function used to output verbose information */
-int Curl_debug(struct Curl_easy *data, curl_infotype type,
-               char *ptr, size_t size);
+void Curl_debug(struct Curl_easy *data, curl_infotype type,
+                char *ptr, size_t size);
 
 
 #endif /* HEADER_CURL_SENDF_H */