]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests/server: replace 4 remaining `send()` calls with `swrite()`
authorViktor Szakats <commit@vsz.me>
Wed, 28 Jan 2026 13:35:18 +0000 (14:35 +0100)
committerViktor Szakats <commit@vsz.me>
Wed, 28 Jan 2026 14:09:51 +0000 (15:09 +0100)
They were masked by `()`, which was also not necessary anymore.

Follow-up to 483f4291fb8134a31c437e82212d541782121ad7 #20459
Follow-up to a585cc35e57fc06806443207e31a244c9df029bb #20097
Follow-up to bf7375ecc50e857760b0d0a668c436e208a400bd #18503

Closes #20460

tests/server/socksd.c

index 2fa11530c698509901187bb3fdd2d9fd0230b70e..9875a2b7a96e75cad1b96e226a287b5706afa2c9 100644 (file)
@@ -273,7 +273,7 @@ static curl_socket_t socks4(curl_socket_t fd,
   response[1] = cd; /* result */
   /* copy port and address from connect request */
   memcpy(&response[2], &buffer[SOCKS4_DSTPORT], 6);
-  rc = (send)(fd, (char *)response, 8, 0);
+  rc = swrite(fd, response, 8);
   if(rc != 8) {
     logmsg("Sending SOCKS4 response failed!");
     return CURL_SOCKET_BAD;
@@ -344,7 +344,7 @@ static curl_socket_t sockit(curl_socket_t fd)
   /* respond with two bytes: VERSION + METHOD */
   response[0] = s_config.responseversion;
   response[1] = s_config.responsemethod;
-  rc = (send)(fd, (char *)response, 2, 0);
+  rc = swrite(fd, response, 2);
   if(rc != 2) {
     logmsg("Sending response failed!");
     return CURL_SOCKET_BAD;
@@ -401,7 +401,7 @@ static curl_socket_t sockit(curl_socket_t fd)
     }
     response[0] = 1;
     response[1] = login ? 0 : 1;
-    rc = (send)(fd, (char *)response, 2, 0);
+    rc = swrite(fd, response, 2);
     if(rc != 2) {
       logmsg("Sending auth response failed!");
       return CURL_SOCKET_BAD;
@@ -548,7 +548,7 @@ static curl_socket_t sockit(curl_socket_t fd)
   memcpy(&response[SOCKS5_BNDADDR + len],
          &buffer[SOCKS5_DSTADDR + len], sizeof(socksport));
 
-  rc = (send)(fd, (char *)response, (SEND_TYPE_ARG3)(len + 6), 0);
+  rc = swrite(fd, response, len + 6);
   if(rc != (len + 6)) {
     logmsg("Sending connect response failed!");
     return CURL_SOCKET_BAD;