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

Method SerializeTag

src/libs/ec/cpp/ECMemSocket.cpp:49–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49std::vector<unsigned char> CECMemSocket::SerializeTag(const CECTag &tag)
50{
51 CECMemSocket mem;
52 // Walk the tag into the per-instance buffer chain. Serialize emits
53 // name + type + length + body + nested children — a self-contained
54 // blob that can be re-inserted as a child of any later response by
55 // just writing the bytes through a real connection's WriteBuffer.
56 tag.Serialize(mem);
57 // Tag serialization does not zlib-encode (we asked for raw bytes by
58 // keeping EC_FLAG_ZLIB out of m_tx_flags), so FlushBuffers has no
59 // trailing deflate state to flush — but it does cycle the in-flight
60 // CQueuedData into m_output_queue, which is what we drain next.
61 mem.FlushBuffers();
62 mem.OnOutput(); // drains m_output_queue → InternalWrite → m_bytes
63 return mem.TakeBytes();
64}

Callers

nothing calls this directly

Calls 4

SerializeMethod · 0.80
FlushBuffersMethod · 0.80
OnOutputMethod · 0.80
TakeBytesMethod · 0.80

Tested by

no test coverage detected