MCPcopy Create free account
hub / github.com/MultiMC/Launcher / finalizeCache

Method finalizeCache

launcher/net/MetaCacheSink.cpp:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42JobStatus MetaCacheSink::finalizeCache(QNetworkReply & reply)
43{
44 QFileInfo output_file_info(m_filename);
45 if(wroteAnyData)
46 {
47 m_entry->setMD5Sum(m_md5Node->hash().toHex().constData());
48 }
49 m_entry->setETag(reply.rawHeader("ETag").constData());
50 if (reply.hasRawHeader("Last-Modified"))
51 {
52 m_entry->setRemoteChangedTimestamp(reply.rawHeader("Last-Modified").constData());
53 }
54 m_entry->setLocalChangedTimestamp(output_file_info.lastModified().toUTC().toMSecsSinceEpoch());
55 m_entry->setStale(false);
56 APPLICATION->metacache()->updateEntry(m_entry);
57 return Job_Finished;
58}
59
60bool MetaCacheSink::hasLocalData()
61{

Callers

nothing calls this directly

Calls 8

setMD5SumMethod · 0.80
hashMethod · 0.80
setETagMethod · 0.80
updateEntryMethod · 0.80
metacacheMethod · 0.80
setStaleMethod · 0.45

Tested by

no test coverage detected