From b7f435b50e591ca2c485e13c06c426b64ecd4090 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Aug 2011 17:51:28 +0200 Subject: output/httpd: don't warn on client disconnect This warning should only be logged when we really received something. When the client disconnects, G_IO_IN is triggered, and the read returns G_IO_STATUS_EOF. --- NEWS | 1 + src/output/httpd_client.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3cc704ef0..c083ea2ed 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ ver 0.16.4 (2011/??/??) - vorbis: don't send end-of-stream on flush * output: - alsa: fix SIGFPE when alsa announces a period size of 0 + - httpd: don't warn on client disconnect ver 0.16.3 (2011/06/04) diff --git a/src/output/httpd_client.c b/src/output/httpd_client.c index f5e14925b..df2f2a9e6 100644 --- a/src/output/httpd_client.c +++ b/src/output/httpd_client.c @@ -370,7 +370,14 @@ httpd_client_read(struct httpd_client *client) if (client->state == RESPONSE) { /* the client has already sent the request, and he must not send more */ - g_warning("unexpected input from client"); + char buffer[1]; + + status = g_io_channel_read_chars(client->channel, buffer, + sizeof(buffer), &bytes_read, + NULL); + if (status == G_IO_STATUS_NORMAL) + g_warning("unexpected input from client"); + return false; } -- cgit v1.2.3