MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / bin_append_buffer

Function bin_append_buffer

bin_interface.c:144–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144int bin_append_buffer(bin_packet_t *packet, str *buf)
145{
146 if (!packet->buffer.s || !packet->size) {
147 LM_ERR("not initialized yet, call bin_init before altering buffer\n");
148 return -1;
149 }
150
151 if (packet->buffer.len + buf->len > packet->size) {
152 if (bin_extend(packet, buf->len) < 0)
153 return -1;
154 }
155
156 memcpy(packet->buffer.s + packet->buffer.len, buf->s, buf->len);
157 packet->buffer.len += buf->len;
158 set_len(packet);
159
160 return packet->buffer.len;
161}
162
163/*
164 * copies the given string at the end position in the packet

Callers 5

replicate_entity_createFunction · 0.85
replicate_entity_updateFunction · 0.85
replicate_entity_deleteFunction · 0.85
pack_entities_syncFunction · 0.85
run_create_cb_allFunction · 0.85

Calls 2

bin_extendFunction · 0.85
set_lenFunction · 0.85

Tested by

no test coverage detected