A small memory footprint AMQP implimentation
Dependents: iothub_client_sample_amqp remote_monitoring simplesample_amqp
Diff: frame_codec.c
- Revision:
- 25:1101516ee67d
- Parent:
- 23:1111ee8bcba4
- Child:
- 28:add19eb7defa
diff -r 2c59c2d43ebf -r 1101516ee67d frame_codec.c --- a/frame_codec.c Mon May 08 10:50:45 2017 -0700 +++ b/frame_codec.c Mon May 22 10:35:21 2017 -0700 @@ -643,6 +643,8 @@ /* Codes_SRS_FRAME_CODEC_01_064: [The frame is malformed if the size is less than the size of the frame header (8 bytes).] */ unsigned char frame_header[6]; size_t current_pos = 0; + /* Codes_SRS_FRAME_CODEC_01_090: [If the type_specific_size - 2 does not divide by 4, frame_codec_encode_frame shall pad the type_specific bytes with zeroes so that type specific data is according to the AMQP ISO.] */ + unsigned char padding_bytes[] = { 0x00, 0x00, 0x00 }; frame_header[0] = (frame_size >> 24) & 0xFF; frame_header[1] = (frame_size >> 16) & 0xFF; @@ -663,9 +665,6 @@ } /* send padding bytes */ - /* Codes_SRS_FRAME_CODEC_01_090: [If the type_specific_size - 2 does not divide by 4, frame_codec_encode_frame shall pad the type_specific bytes with zeroes so that type specific data is according to the AMQP ISO.] */ - unsigned char padding_bytes[] = { 0x00, 0x00, 0x00 }; - if (padding_byte_count > 0) { (void)memcpy(encoded_frame + current_pos, padding_bytes, padding_byte_count);