mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Ranges work now.
This commit is contained in:
parent
41f4ec2d50
commit
803655dba9
@ -1483,8 +1483,7 @@ static void parse_range_field(struct connection *conn)
|
|||||||
if (bound1 != bound2)
|
if (bound1 != bound2)
|
||||||
{
|
{
|
||||||
conn->range_begin_given = 1;
|
conn->range_begin_given = 1;
|
||||||
conn->range_begin = (size_t)strtol(range+bound1, NULL, 10);
|
conn->range_begin = (off_t)strtoll(range+bound1, NULL, 10);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* parse number after hyphen */
|
/* parse number after hyphen */
|
||||||
@ -1500,7 +1499,7 @@ static void parse_range_field(struct connection *conn)
|
|||||||
if (bound1 != bound2)
|
if (bound1 != bound2)
|
||||||
{
|
{
|
||||||
conn->range_end_given = 1;
|
conn->range_end_given = 1;
|
||||||
conn->range_end = (size_t)strtol(range+bound1, NULL, 10);
|
conn->range_end = (off_t)strtoll(range+bound1, NULL, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(0); /* break handling */
|
while(0); /* break handling */
|
||||||
@ -1918,7 +1917,7 @@ static void process_get(struct connection *conn)
|
|||||||
|
|
||||||
if (conn->range_begin_given || conn->range_end_given)
|
if (conn->range_begin_given || conn->range_end_given)
|
||||||
{
|
{
|
||||||
size_t from, to;
|
off_t from, to;
|
||||||
|
|
||||||
if (conn->range_begin_given && conn->range_end_given)
|
if (conn->range_begin_given && conn->range_end_given)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user