Set lastModified attribute for a plugin stream b=58134 a=av sr=buster

git-svn-id: svn://10.0.0.236/trunk@83507 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterlubczynski%netscape.com
2000-12-12 01:00:28 +00:00
parent 2e737df19b
commit f97aecfa0a
2 changed files with 38 additions and 2 deletions

View File

@@ -1359,7 +1359,25 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIChannel* channel,
mSetUpListener = PR_TRUE;
mPluginStreamInfo->SetSeekable(PR_FALSE);
//mPluginStreamInfo->SetModified(??);
// get Last-Modified header for plugin info
nsCOMPtr<nsIHTTPChannel> theHTTPChannel = do_QueryInterface(channel);
if (theHTTPChannel) {
char * lastModified;
nsCOMPtr<nsIAtom> header = NS_NewAtom("last-modified");
theHTTPChannel->GetResponseHeader(header, &lastModified);
if (lastModified) {
PRTime time64;
PR_ParseTimeString(lastModified, PR_TRUE, &time64); //convert string time to interger time
// Convert PRTime to unix-style time_t, i.e. seconds since the epoch
double fpTime;
LL_L2D(fpTime, time64);
mPluginStreamInfo->SetLastModified((PRUint32)(fpTime * 1e-6 + 0.5));
nsCRT::free(lastModified);
}
}
char* urlString;
aURL->GetSpec(&urlString);

View File

@@ -1359,7 +1359,25 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIChannel* channel,
mSetUpListener = PR_TRUE;
mPluginStreamInfo->SetSeekable(PR_FALSE);
//mPluginStreamInfo->SetModified(??);
// get Last-Modified header for plugin info
nsCOMPtr<nsIHTTPChannel> theHTTPChannel = do_QueryInterface(channel);
if (theHTTPChannel) {
char * lastModified;
nsCOMPtr<nsIAtom> header = NS_NewAtom("last-modified");
theHTTPChannel->GetResponseHeader(header, &lastModified);
if (lastModified) {
PRTime time64;
PR_ParseTimeString(lastModified, PR_TRUE, &time64); //convert string time to interger time
// Convert PRTime to unix-style time_t, i.e. seconds since the epoch
double fpTime;
LL_L2D(fpTime, time64);
mPluginStreamInfo->SetLastModified((PRUint32)(fpTime * 1e-6 + 0.5));
nsCRT::free(lastModified);
}
}
char* urlString;
aURL->GetSpec(&urlString);