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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user