1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

r9389: handle errors reading from files in web server

bug found by coverity
(This used to be commit 1a3229777adf12f8148267af7b33689ebe880ed8)
This commit is contained in:
Andrew Tridgell 2005-08-18 12:19:16 +00:00 committed by Gerald (Jerry) Carter
parent 71f34f401e
commit b60ef4ee09

View File

@ -153,13 +153,14 @@ static void websrv_send(struct stream_connection *conn, uint16_t flags)
web->output.nsent = 0;
nread = read(web->output.fd, buf, sizeof(buf));
if (nread == 0) {
close(web->output.fd);
web->output.fd = -1;
}
if (nread == -1 && errno == EINTR) {
return;
}
if (nread <= 0) {
close(web->output.fd);
web->output.fd = -1;
nread = 0;
}
web->output.content = data_blob_talloc(web, buf, nread);
}