http_streamer: don't access headers before HeadersReceived.

UpdateSize uses HttpResult::Length, which relies on the
contetn-length header to be already received from the server. Doing it
in ConnectionOpened will not work. Doing it from HeadersReceived, which
is called a bit later, will work.

This allows using the http_streamer in webkit for youtube video playing,
and should fix all uses with a fixed size resource (rather than an
endless stream).
This commit is contained in:
Adrien Destugues
2016-10-30 23:53:00 +01:00
parent cec123b4de
commit a5b5f89612
@@ -43,12 +43,15 @@ public:
void ConnectionOpened(BUrlRequest* request)
{
fAdapterIO->UpdateSize();
fRequest = request;
fRunning = true;
}
void HeadersReceived(BUrlRequest* request)
{
fAdapterIO->UpdateSize();
}
void DataReceived(BUrlRequest* request, const char* data,
off_t position, ssize_t size)
{