summaryrefslogtreecommitdiff
path: root/source4/web_server
diff options
context:
space:
mode:
Diffstat (limited to 'source4/web_server')
-rw-r--r--source4/web_server/web_server.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/web_server/web_server.c b/source4/web_server/web_server.c
index 80e479d8a7..4962185526 100644
--- a/source4/web_server/web_server.c
+++ b/source4/web_server/web_server.c
@@ -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);
}