MCPcopy Create free account
hub / github.com/defold/defold / GetETag

Function GetETag

engine/dlib/src/dlib/http_cache.cpp:638–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636 }
637
638 Result GetETag(HCache cache, const char* uri, char* tag_buffer, uint32_t tag_buffer_len)
639 {
640 dmMutex::ScopedLock lock(cache->m_Mutex);
641
642 uint64_t uri_hash = dmHashString64(uri);
643 Entry* entry = cache->m_CacheTable.Get(uri_hash);
644 if (entry != 0)
645 {
646 if (entry->m_Info.m_ETag[0]) {
647 dmStrlCpy(tag_buffer, entry->m_Info.m_ETag, tag_buffer_len);
648 return RESULT_OK;
649 } else {
650 return RESULT_NO_ETAG;
651 }
652 }
653 else
654 {
655 return RESULT_NO_ENTRY;
656 }
657 }
658
659 Result GetInfo(HCache cache, const char* uri, EntryInfo* info)
660 {

Callers 3

SendRequestFunction · 0.70
HandleCachedFunction · 0.70
TEST_FFunction · 0.50

Calls 2

dmStrlCpyFunction · 0.85
GetMethod · 0.45

Tested by 1

TEST_FFunction · 0.40