From 051cfc228d89d95cd050daacbf7a73cd259a4a2e Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Wed, 9 Jun 2004 18:28:18 +0000 Subject: fix bug where inputStream_httpRead was returning 0 when cnnection closed, but data is still left in the buffer git-svn-id: https://svn.musicpd.org/mpd/trunk@1425 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputStream_http.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/inputStream_http.c b/src/inputStream_http.c index 51e562c01..1bfec0caa 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -490,14 +490,15 @@ size_t inputStream_httpRead(InputStream * inStream, void * ptr, size_t size, switch(data->connState) { case HTTP_CONN_STATE_OPEN: + if(data->prebuffer || data->buflen < data->icyMetaint) return 0; + + break; case HTTP_CONN_STATE_CLOSED: - break; + if(data->buflen) break; default: return 0; } - if(data->prebuffer || data->buflen < data->icyMetaint) return 0; - if(data->icyMetaint > 0) { if(data->icyOffset >= data->icyMetaint) { int metalen = *(data->buffer); -- cgit v1.2.3