1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-11-03 04:17:17 -05:00

a few fixes from karl...

svn path=/icecast/trunk/icecast/; revision=8201
This commit is contained in:
oddsock 2004-11-15 15:50:59 +00:00
parent 726e8fc099
commit acbef39c57

View File

@ -432,20 +432,25 @@ int fserve_client_create(client_t *httpclient, char *path)
time_t now;
int strflen;
time(&now);
struct tm result;
int64_t endpos = rangenumber+new_content_len-1;
if (endpos < 0) {
endpos = 0;
}
strflen = strftime(currenttime, 50, "%a, %d-%b-%Y %X GMT",
gmtime(&now));
gmtime_r(&now, &result));
httpclient->respcode = 206;
bytes = sock_write(httpclient->con->sock,
"HTTP/1.1 206 Partial Content\r\n"
"Date: %s\r\n"
"Content-Length: %ld\r\n"
"Content-Length: " FORMAT_INT64 "\r\n"
"Content-Range: bytes " FORMAT_INT64 \
"-" FORMAT_INT64 "/" FORMAT_INT64 "\r\n"
"Content-Type: %s\r\n\r\n",
currenttime,
new_content_len,
rangenumber,
client->content_length-1,
endpos,
client->content_length,
fserve_content_type(path));
if(bytes > 0) httpclient->con->sent_bytes = bytes;