Write an empty response to clients

This commit is contained in:
Camden Dixie O'Brien 2022-10-13 14:57:26 +01:00
parent 1a13289da9
commit fa0dbed44c

13
main.c
View File

@ -142,8 +142,17 @@ int main(int argc, char *argv[])
goto close_client_socket;
}
sbuf[slen] = '\0';
printf("Received selector: \"%s\"\n", sbuf);
/*
* Write an empty response to the client.
*/
do {
errno = 0;
n = write(cfd, ".\r\n", 3);
} while (errno == EINTR);
if (n == -1) {
fprintf(stderr, "Error sending response to client\n");
goto close_client_socket;
}
close_client_socket:
close(cfd);