1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -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; time_t now;
int strflen; int strflen;
time(&now); 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", strflen = strftime(currenttime, 50, "%a, %d-%b-%Y %X GMT",
gmtime(&now)); gmtime_r(&now, &result));
httpclient->respcode = 206; httpclient->respcode = 206;
bytes = sock_write(httpclient->con->sock, bytes = sock_write(httpclient->con->sock,
"HTTP/1.1 206 Partial Content\r\n" "HTTP/1.1 206 Partial Content\r\n"
"Date: %s\r\n" "Date: %s\r\n"
"Content-Length: %ld\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"
"Content-Type: %s\r\n\r\n", "Content-Type: %s\r\n\r\n",
currenttime, currenttime,
new_content_len, new_content_len,
rangenumber, rangenumber,
client->content_length-1, endpos,
client->content_length, client->content_length,
fserve_content_type(path)); fserve_content_type(path));
if(bytes > 0) httpclient->con->sent_bytes = bytes; if(bytes > 0) httpclient->con->sent_bytes = bytes;