Fixes 89191. r=gagan, av, peterl.

This commit is contained in:
dougt%netscape.com 2001-07-17 01:19:19 +00:00
Родитель 9e8cd9b541
Коммит 5a8084ee00
3 изменённых файлов: 37 добавлений и 1 удалений

Просмотреть файл

@ -2065,6 +2065,22 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
mPluginStreamInfo->SetSeekable(bSeekable); 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 // get Last-Modified header for plugin info
if (httpChannel) if (httpChannel)
{ {

Просмотреть файл

@ -2065,6 +2065,22 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
mPluginStreamInfo->SetSeekable(bSeekable); 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 // get Last-Modified header for plugin info
if (httpChannel) if (httpChannel)
{ {

Просмотреть файл

@ -434,8 +434,12 @@ nsHttpTransaction::HandleContentStart()
// eliminate any references to this content length value, so our // eliminate any references to this content length value, so our
// consumers don't get confused. // consumers don't get confused.
mContentLength = -1; mContentLength = -1;
mResponseHead->SetHeader(nsHttp::Content_Length, nsnull);
mResponseHead->SetContentLength(-1); 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);
} }
} }