MCPcopy Create free account
hub / github.com/apache/qpid-proton / pn_buffer_trim

Function pn_buffer_trim

c/src/core/buffer.c:194–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right)
195{
196 if (left + right > buf->size) return PN_ARG_ERR;
197
198 // In special case where we trim everything just clear buffer
199 if (left + right == buf->size) {
200 pn_buffer_clear(buf);
201 return 0;
202 }
203 buf->start += left;
204 if (buf->start >= buf->capacity)
205 buf->start -= buf->capacity;
206
207 buf->size -= left + right;
208
209 return 0;
210}
211
212void pn_buffer_clear(pn_buffer_t *buf)
213{

Callers 6

pn_link_recvFunction · 0.85
pn_dispatcher_outputFunction · 0.85
app_inbytes_progressFunction · 0.85

Calls 1

pn_buffer_clearFunction · 0.85

Tested by

no test coverage detected