summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-05-22 21:45:58 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-05-22 21:47:37 +0200
commit38eafbf8bf2aaae998aae3801350cdc437fd9cd2 (patch)
treeefaa8749ad7268c7d4128736d9c0db458ac4bd0d
parenta3a12a524c41f45d9cd9ebaa94cb22dc1456e6b1 (diff)
downloadpianobar-38eafbf8bf2aaae998aae3801350cdc437fd9cd2.tar.gz
pianobar-38eafbf8bf2aaae998aae3801350cdc437fd9cd2.tar.bz2
pianobar-38eafbf8bf2aaae998aae3801350cdc437fd9cd2.zip
waitress: Add _RET_READ_ERR, retry on read error in player
Enhances commit 279f3ba93b729684e54300352c59523bd05e54bc
-rw-r--r--libwaitress/src/main.c2
-rw-r--r--libwaitress/src/waitress.h3
-rw-r--r--src/player.c4
3 files changed, 5 insertions, 4 deletions
diff --git a/libwaitress/src/main.c b/libwaitress/src/main.c
index 43721f0..a9acbd7 100644
--- a/libwaitress/src/main.c
+++ b/libwaitress/src/main.c
@@ -257,7 +257,7 @@ WaitressReturn_t WaitressPollRead (int sockfd, char *buf, size_t count,
return WAITRESS_RET_ERR;
}
if ((*retSize = read (sockfd, buf, count)) == -1) {
- return WAITRESS_RET_ERR;
+ return WAITRESS_RET_READ_ERR;
}
return WAITRESS_RET_OK;
}
diff --git a/libwaitress/src/waitress.h b/libwaitress/src/waitress.h
index b05d786..3bcf524 100644
--- a/libwaitress/src/waitress.h
+++ b/libwaitress/src/waitress.h
@@ -55,7 +55,8 @@ typedef enum {WAITRESS_RET_ERR = 0, WAITRESS_RET_OK, WAITRESS_RET_STATUS_UNKNOWN
WAITRESS_RET_NOTFOUND, WAITRESS_RET_FORBIDDEN, WAITRESS_RET_CONNECT_REFUSED,
WAITRESS_RET_SOCK_ERR, WAITRESS_RET_GETADDR_ERR,
WAITRESS_RET_CB_ABORT, WAITRESS_RET_HDR_OVERFLOW,
- WAITRESS_RET_PARTIAL_FILE, WAITRESS_RET_TIMEOUT} WaitressReturn_t;
+ WAITRESS_RET_PARTIAL_FILE, WAITRESS_RET_TIMEOUT, WAITRESS_RET_READ_ERR}
+ WaitressReturn_t;
void WaitressInit (WaitressHandle_t *);
void WaitressFree (WaitressHandle_t *);
diff --git a/src/player.c b/src/player.c
index abbd5c7..4768ecc 100644
--- a/src/player.c
+++ b/src/player.c
@@ -449,8 +449,8 @@ void *BarPlayerThread (void *data) {
snprintf (extraHeaders, sizeof (extraHeaders), "Range: bytes=%u-\r\n",
player->bytesReceived);
wRet = WaitressFetchCall (&player->waith);
- } while (wRet == WAITRESS_RET_PARTIAL_FILE ||
- wRet == WAITRESS_RET_TIMEOUT);
+ } while (wRet == WAITRESS_RET_PARTIAL_FILE || wRet == WAITRESS_RET_TIMEOUT
+ || wRet == WAITRESS_RET_READ_ERR);
switch (player->audioFormat) {
#ifdef ENABLE_FAAD