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

Function pn_buffer_append

c/src/core/buffer.c:142–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size)
143{
144 if (!size) return 0;
145 int err = pn_buffer_ensure(buf, size);
146 if (err) return err;
147
148 size_t tail = pni_buffer_tail(buf);
149 size_t tail_space = pni_buffer_tail_space(buf);
150 size_t n = pn_min(tail_space, size);
151
152 // Heuristic check for a strange usage in messenger
153 if (bytes!=buf->bytes+tail) {
154 memcpy(buf->bytes + tail, bytes, n);
155 memcpy(buf->bytes, bytes + n, size - n);
156 }
157 buf->size += size;
158
159 return 0;
160}
161
162static size_t pni_buffer_index(pn_buffer_t *buf, size_t index)
163{

Callers 10

pni_data_internFunction · 0.85
pn_do_transferFunction · 0.85
pn_link_sendFunction · 0.85
pn_write_frameFunction · 0.85
pni_pump_inFunction · 0.85
pn_messenger_putFunction · 0.85
app_inbytes_addFunction · 0.85
app_inbytes_progressFunction · 0.85

Calls 3

pn_buffer_ensureFunction · 0.85
pni_buffer_tailFunction · 0.85
pni_buffer_tail_spaceFunction · 0.85

Tested by

no test coverage detected