tests/server: replace 4 remaining send() calls with swrite()

They were masked by `()`, which was also not necessary anymore.

Follow-up to 483f4291fb #20459
Follow-up to a585cc35e5 #20097
Follow-up to bf7375ecc5 #18503

Closes #20460
This commit is contained in:
Viktor Szakats 2026-01-28 14:35:18 +01:00
parent 483f4291fb
commit 2e5cc08d25
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View 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;