Skip to content
Snippets Groups Projects
Commit c7a61ce2 authored by Martin Nilsson's avatar Martin Nilsson
Browse files

A few byte range fixes. Implementation still broken though.

Rev: lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Request.pike:1.52
parent e1118e37
No related branches found
No related tags found
No related merge requests found
...@@ -587,9 +587,9 @@ void response_and_finish(mapping m, function|void _log_cb) ...@@ -587,9 +587,9 @@ void response_and_finish(mapping m, function|void _log_cb)
int a,b; int a,b;
if (sscanf(request_headers->range,"bytes%*[ =]%d-%d",a,b)==3) if (sscanf(request_headers->range,"bytes%*[ =]%d-%d",a,b)==3)
m->start=a,m->stop=b; m->start=a,m->stop=b;
else if (sscanf(request_headers->range,"bytes%*[ =]-%d",b)) else if (sscanf(request_headers->range,"bytes%*[ =]-%d",b)==2)
{ {
if( m->size==-1 ) if( m->size==-1 || m->size < b )
{ {
m_delete(m,"file"); m_delete(m,"file");
m->data=""; m->data="";
...@@ -601,7 +601,7 @@ void response_and_finish(mapping m, function|void _log_cb) ...@@ -601,7 +601,7 @@ void response_and_finish(mapping m, function|void _log_cb)
m->stop=-1; m->stop=-1;
} }
} }
else if (sscanf(request_headers->range,"bytes%*[ =]%d-",a)) else if (sscanf(request_headers->range,"bytes%*[ =]%d-",a)==2)
m->start=a,m->stop=-1; m->start=a,m->stop=-1;
else if (has_value(request_headers->range, ",")) else if (has_value(request_headers->range, ","))
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment