mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
svn path=/icecast/trunk/icecast/; revision=14006
This commit is contained in:
parent
55b5b7eb80
commit
f9c3fc91a7
@ -33,6 +33,7 @@
|
|||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
#define strncasecmp _strnicmp
|
||||||
#define S_ISREG(mode) ((mode) & _S_IFREG)
|
#define S_ISREG(mode) ((mode) & _S_IFREG)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -501,8 +502,12 @@ int fserve_client_create (client_t *httpclient, const char *path)
|
|||||||
content_length = (int64_t)file_buf.st_size;
|
content_length = (int64_t)file_buf.st_size;
|
||||||
range = httpp_getvar (httpclient->parser, "range");
|
range = httpp_getvar (httpclient->parser, "range");
|
||||||
|
|
||||||
|
/* full http range handling is currently not done but we deal with the common case */
|
||||||
if (range != NULL) {
|
if (range != NULL) {
|
||||||
ret = sscanf(range, "bytes=" FORMAT_INT64 "-", &rangenumber);
|
ret = 0;
|
||||||
|
if (strncasecmp (range, "bytes=", 6) == 0)
|
||||||
|
ret = sscanf (range+6, FORMAT_INT64 "-", &rangenumber);
|
||||||
|
|
||||||
if (ret != 1) {
|
if (ret != 1) {
|
||||||
/* format not correct, so lets just assume
|
/* format not correct, so lets just assume
|
||||||
we start from the beginning */
|
we start from the beginning */
|
||||||
@ -542,6 +547,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
|
|||||||
bytes = snprintf (httpclient->refbuf->data, BUFSIZE,
|
bytes = snprintf (httpclient->refbuf->data, BUFSIZE,
|
||||||
"HTTP/1.1 206 Partial Content\r\n"
|
"HTTP/1.1 206 Partial Content\r\n"
|
||||||
"Date: %s\r\n"
|
"Date: %s\r\n"
|
||||||
|
"Accept-Ranges: bytes\r\n"
|
||||||
"Content-Length: " FORMAT_INT64 "\r\n"
|
"Content-Length: " FORMAT_INT64 "\r\n"
|
||||||
"Content-Range: bytes " FORMAT_INT64 \
|
"Content-Range: bytes " FORMAT_INT64 \
|
||||||
"-" FORMAT_INT64 "/" FORMAT_INT64 "\r\n"
|
"-" FORMAT_INT64 "/" FORMAT_INT64 "\r\n"
|
||||||
@ -567,6 +573,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
|
|||||||
httpclient->respcode = 200;
|
httpclient->respcode = 200;
|
||||||
bytes = snprintf (httpclient->refbuf->data, BUFSIZE,
|
bytes = snprintf (httpclient->refbuf->data, BUFSIZE,
|
||||||
"HTTP/1.0 200 OK\r\n"
|
"HTTP/1.0 200 OK\r\n"
|
||||||
|
"Accept-Ranges: bytes\r\n"
|
||||||
"Content-Length: " FORMAT_INT64 "\r\n"
|
"Content-Length: " FORMAT_INT64 "\r\n"
|
||||||
"Content-Type: %s\r\n\r\n",
|
"Content-Type: %s\r\n\r\n",
|
||||||
content_length,
|
content_length,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user