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

This commit is contained in:
peterlubczynski@netscape.com
2000-12-12 01:00:28 +00:00
parent 3939717e5c
commit 2c51f0a671
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);