diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-05-18 04:04:54 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-05-18 04:04:54 +0000 |
commit | 06422f729b8f6937d33d7c6c9156f4f3a5fdc731 (patch) | |
tree | 1844056777461a1675cd4919c0fdf316c264574e | |
parent | 746e7477e047a78296fc60347448720add025bce (diff) | |
download | mpd-06422f729b8f6937d33d7c6c9156f4f3a5fdc731.tar.gz mpd-06422f729b8f6937d33d7c6c9156f4f3a5fdc731.tar.xz mpd-06422f729b8f6937d33d7c6c9156f4f3a5fdc731.zip |
bug fixes for playing streams
git-svn-id: https://svn.musicpd.org/mpd/trunk@1053 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/inputStream_http.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; } |