From b5ac68a1d865b6252a31d17c36ae8c80aea5f8f4 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 3 May 2009 20:54:06 +0200 Subject: Fix range header, accept 206 status code --- libwaitress/src/main.c | 5 +++-- src/player.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libwaitress/src/main.c b/libwaitress/src/main.c index f51d991..f9ec460 100644 --- a/libwaitress/src/main.c +++ b/libwaitress/src/main.c @@ -289,8 +289,9 @@ WaitressReturn_t WaitressFetchCall (WaitressHandle_t *waith) { read (sockfd, statusBuf, sizeof (statusBuf)); switch (statusBuf[0]) { case '2': - if (statusBuf[1] == '0' && statusBuf[2] == '0') { - /* 200 OK */ + if (statusBuf[1] == '0' && + (statusBuf[2] == '0' || statusBuf[2] == '6')) { + /* 200 OK/206 Partial Content */ } else { CLOSE_RET (WAITRESS_RET_STATUS_UNKNOWN); } diff --git a/src/player.c b/src/player.c index 3acfe58..46c3fff 100644 --- a/src/player.c +++ b/src/player.c @@ -446,7 +446,7 @@ void *BarPlayerThread (void *data) { /* This loop should work around song abortions by requesting the * missing part of the song */ do { - snprintf (extraHeaders, sizeof (extraHeaders), "Range: %u-\r\n", + snprintf (extraHeaders, sizeof (extraHeaders), "Range: bytes=%u-\r\n", player->bytesReceived); wRet = WaitressFetchCall (&player->waith); } while (wRet == WAITRESS_RET_PARTIAL_FILE); -- cgit v1.2.3