From 06422f729b8f6937d33d7c6c9156f4f3a5fdc731 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 18 May 2004 04:04:54 +0000 Subject: bug fixes for playing streams git-svn-id: https://svn.musicpd.org/mpd/trunk@1053 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputStream_http.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/inputStream_http.c b/src/inputStream_http.c index 7be2bc38c..5c99a8ec0 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -220,7 +220,7 @@ static int finishHTTPInit(InputStream * inStream) { return -1; } - memset(request, 0, 2048); + memset(request, 0, 2049); snprintf(request, 2048, "GET %s HTTP/1.1\r\n" "Host: %s\r\n" "Connection: close\r\n" @@ -266,6 +266,7 @@ static int getHTTPHello(InputStream * inStream) { if(ret < 0) { data->connState = HTTP_CONN_STATE_CLOSED; close(data->sock); + data->buflen = 0; return -1; } @@ -283,6 +284,7 @@ static int getHTTPHello(InputStream * inStream) { if(readed <= 0) { data->connState = HTTP_CONN_STATE_CLOSED; close(data->sock); + data->buflen = 0; return -1; } @@ -475,7 +477,7 @@ size_t inputStream_httpRead(InputStream * inStream, void * ptr, size_t size, data->buflen -= readed; memmove(data->buffer, data->buffer+readed, data->buflen); - inStream->offset = readed; + inStream->offset+= readed; return readed; } -- cgit v1.2.3