MCPcopy Create free account
hub / github.com/amule-project/amule / BuildSharedFileCacheTag

Function BuildSharedFileCacheTag

src/ExternalConn.cpp:1125–1133  ·  view source on GitHub ↗

Build a CEC_SharedFile_Tag for the per-file cache. The output is self-contained — the encoder is reset before each Encode call in FULL mode (see Get_EC_Response_GetSharedFiles), so a local encoder suffices. Caller owns the returned tag.

Source from the content-addressed store, hash-verified

1123// FULL mode (see Get_EC_Response_GetSharedFiles), so a local encoder
1124// suffices. Caller owns the returned tag.
1125static CECTag *BuildSharedFileCacheTag(const void *file_v)
1126{
1127 const CKnownFile *cur_file = static_cast<const CKnownFile *>(file_v);
1128 CEC_SharedFile_Tag *filetag = new CEC_SharedFile_Tag(cur_file, EC_DETAIL_FULL);
1129 CKnownFile_Encoder enc(cur_file);
1130 enc.ResetEncoder();
1131 enc.Encode(filetag);
1132 return filetag;
1133}
1134
1135
1136// Same shape for partfiles.

Callers

nothing calls this directly

Calls 2

ResetEncoderMethod · 0.45
EncodeMethod · 0.45

Tested by

no test coverage detected