mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
Fixes 89191. r=gagan, av, peterl.
This commit is contained in:
parent
9e8cd9b541
commit
5a8084ee00
@ -2065,6 +2065,22 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
|
||||
|
||||
mPluginStreamInfo->SetSeekable(bSeekable);
|
||||
|
||||
PRUint32 length = -1;
|
||||
mPluginStreamInfo->GetLength(&length);
|
||||
if (bSeekable && length == -1 && httpChannel) {
|
||||
nsXPIDLCString tmp;
|
||||
httpChannel->GetResponseHeader("Content-Length", getter_Copies(tmp));
|
||||
if (tmp.get()) {
|
||||
PRInt32 ignore;
|
||||
nsCString lenString (tmp.get());
|
||||
length = lenString.ToInteger(&ignore);
|
||||
mPluginStreamInfo->SetLength(length);
|
||||
}
|
||||
}
|
||||
if (length == -1)
|
||||
mPluginStreamInfo->SetSeekable(PR_FALSE);
|
||||
|
||||
// we require a content len
|
||||
// get Last-Modified header for plugin info
|
||||
if (httpChannel)
|
||||
{
|
||||
|
@ -2065,6 +2065,22 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
|
||||
|
||||
mPluginStreamInfo->SetSeekable(bSeekable);
|
||||
|
||||
PRUint32 length = -1;
|
||||
mPluginStreamInfo->GetLength(&length);
|
||||
if (bSeekable && length == -1 && httpChannel) {
|
||||
nsXPIDLCString tmp;
|
||||
httpChannel->GetResponseHeader("Content-Length", getter_Copies(tmp));
|
||||
if (tmp.get()) {
|
||||
PRInt32 ignore;
|
||||
nsCString lenString (tmp.get());
|
||||
length = lenString.ToInteger(&ignore);
|
||||
mPluginStreamInfo->SetLength(length);
|
||||
}
|
||||
}
|
||||
if (length == -1)
|
||||
mPluginStreamInfo->SetSeekable(PR_FALSE);
|
||||
|
||||
// we require a content len
|
||||
// get Last-Modified header for plugin info
|
||||
if (httpChannel)
|
||||
{
|
||||
|
@ -434,8 +434,12 @@ nsHttpTransaction::HandleContentStart()
|
||||
// eliminate any references to this content length value, so our
|
||||
// consumers don't get confused.
|
||||
mContentLength = -1;
|
||||
mResponseHead->SetHeader(nsHttp::Content_Length, nsnull);
|
||||
mResponseHead->SetContentLength(-1);
|
||||
// if a client is really interested in the content length,
|
||||
// even though we think it is invalid, them them hut for it
|
||||
// in the raw headers.
|
||||
// mResponseHead->SetHeader(nsHttp::Content_Length, nsnull);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user