20 bytes[size++] = (((uint8_t)(value)) & 0x7F) | 0x80;
23 bytes[size++] = (uint8_t) value;
33 size_t amqp_size = envelope->message.body.len;
34 uint32_t size = amqp_size + 4;
35 uint8_t framing[4] = {0};
40 memcpy(buf, framing, size_framing);
41 memcpy(buf + size_framing, envelope->message.body.bytes, amqp_size);
42 return send(sock, buf, size, 0);
int write_protobuf(socket_t sock, amqp_envelope_t *envelope)
Write a protobuf, with a varint32 framing, and padding at the end from an envelope.
int socket_t
Alias to differenciate between regular ints and socket fds.
uint32_t convert_framing_size(uint32_t len, uint8_t *bytes)
Convert an unsigned int to varint32 so that google’s C++ protobuf libs can read it.
Utility to convert framing to varint32 for google’s parser.