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

Function bin_remove_int_buffer_end

bin_interface.c:233–245  ·  view source on GitHub ↗

* removes @count integers from the end of the packet * * @return: * 0: success * < 0: error, no more integers in buffer */

Source from the content-addressed store, hash-verified

231 * < 0: error, no more integers in buffer
232 */
233int bin_remove_int_buffer_end(bin_packet_t *packet, int count)
234{
235 if (!packet->buffer.s || !packet->size ||
236 (int)(packet->buffer.len - count * sizeof(int)) < 0){
237 LM_ERR("binary packet underflow\n");
238 return -1;
239 }
240
241 packet->buffer.len -= count * sizeof(int);
242
243 set_len(packet);
244 return 0;
245}
246
247/*
248 * skips @count integers in the end of the packet

Callers 6

msg_send_retryFunction · 0.85
clusterer_send_msgFunction · 0.85
clusterer_bcast_msgFunction · 0.85
flood_messageFunction · 0.85
send_full_top_updateFunction · 0.85

Calls 1

set_lenFunction · 0.85

Tested by

no test coverage detected