Correctly set O_NONBLOCK flag and disallow further reception using shutdown on saned data fd once a connection is open.

merge-requests/813/head
Tom Meyer-Mallorie 2023-10-07 22:51:00 +01:00
rodzic fd7b83c8f7
commit 7df77203ad
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -2256,8 +2256,8 @@ process_request (Wire * w)
strerror (errno));
return 1;
}
fcntl (data_fd, F_SETFL, 1); /* set non-blocking */
shutdown (data_fd, 0);
fcntl (data_fd, F_SETFL, O_NONBLOCK); /* set non-blocking */
shutdown (data_fd, SHUT_RD);
do_scan (w, h, data_fd);
close (data_fd);
}