MCPcopy Create free account
hub / github.com/apache/trafficserver / read

Function read

plugins/multiplexer/dispatch.cc:104–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104uint64_t
105read(const TSIOBufferReader &r, std::string &o, int64_t l = 0)
106{
107 assert(r != nullptr);
108 TSIOBufferBlock block = TSIOBufferReaderStart(r);
109
110 assert(l >= 0);
111 if (l == 0) {
112 l = TSIOBufferReaderAvail(r);
113 assert(l >= 0);
114 }
115
116 uint64_t length = 0;
117
118 for (; block && l > 0; block = TSIOBufferBlockNext(block)) {
119 int64_t size = 0;
120 const char *const pointer = TSIOBufferBlockReadStart(block, r, &size);
121 if (pointer != nullptr && size > 0) {
122 size = std::min(size, l);
123 o.append(pointer, size);
124 length += size;
125 l -= size;
126 }
127 }
128
129 return length;
130}
131
132uint64_t
133read(const TSIOBuffer &b, std::string &o)

Callers 15

handleMethod · 0.70
readMethod · 0.70
headerMethod · 0.70
dataMethod · 0.70
dispatchFunction · 0.70
handle_readFunction · 0.50
async_pause_jobFunction · 0.50
copyFunction · 0.50
loadFunction · 0.50
process_eventMethod · 0.50
serviceMethod · 0.50

Calls 7

TSIOBufferReaderAvailFunction · 0.85
TSIOBufferReaderAllocFunction · 0.85
TSIOBufferReaderFreeFunction · 0.85
TSIOBufferReaderStartFunction · 0.50
TSIOBufferBlockNextFunction · 0.50
TSIOBufferBlockReadStartFunction · 0.50
appendMethod · 0.45

Tested by 2

load_fileFunction · 0.40