aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputStream_http.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-03-16 06:52:46 +0000
committerEric Wong <normalperson@yhbt.net>2006-03-16 06:52:46 +0000
commit69635022133488e6b19569fb59b16c4658a244eb (patch)
treea7149e6a5a82017ae3821c801433c8794f796aec /src/inputStream_http.c
parentd7e846bdc2d848525ebd4251c4c5d9c5fe0d2705 (diff)
downloadmpd-69635022133488e6b19569fb59b16c4658a244eb.tar.gz
mpd-69635022133488e6b19569fb59b16c4658a244eb.tar.xz
mpd-69635022133488e6b19569fb59b16c4658a244eb.zip
merge with mpd/trunk up to r3925
git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/inputStream_http.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/inputStream_http.c b/src/inputStream_http.c
index 34303dfab..9781b1b7a 100644
--- a/src/inputStream_http.c
+++ b/src/inputStream_http.c
@@ -708,6 +708,20 @@ int inputStream_httpOpen(InputStream * inStream, char * url) {
}
int inputStream_httpSeek(InputStream * inStream, long offset, int whence) {
+ /* hack to reopen an HTTP stream if we're trying to seek to
+ * the beginning */
+ if ((whence == SEEK_SET) && (offset == 0)) {
+ InputStreamHTTPData * data;
+
+ data = (InputStreamHTTPData*)inStream->data;
+ close(data->sock);
+ data->connState = HTTP_CONN_STATE_REOPEN;
+ data->buflen = 0;
+ inStream->offset = 0;
+ return 0;
+ }
+
+ /* otherwise, we don't know how to seek in HTTP yet */
return -1;
}