spend less time petting dogs

This commit is contained in:
p2r3
2025-08-20 06:10:04 +03:00
parent 023b866529
commit a89043394c
2 changed files with 6 additions and 4 deletions

View File

@@ -63,12 +63,12 @@ ssize_t recv_all (int client_fd, void *buf, size_t n, uint8_t require_first) {
return total; // got exactly n bytes
}
ssize_t send_all (int fd, const void *buf, size_t len) {
ssize_t send_all (int client_fd, const void *buf, size_t len) {
const uint8_t *p = (const uint8_t *)buf;
size_t sent = 0;
while (sent < len) {
ssize_t n = send(fd, p + sent, len - sent, MSG_NOSIGNAL);
ssize_t n = send(client_fd, p + sent, len - sent, MSG_NOSIGNAL);
if (n > 0) {
sent += (size_t)n;
continue;