OCPayloadConvert cbor payload size
authorHabib Virji <habib.virji@samsung.com>
Mon, 7 Mar 2016 11:15:32 +0000 (11:15 +0000)
committerHabib Virji <habib.virji@samsung.com>
Tue, 8 Mar 2016 01:04:34 +0000 (01:04 +0000)
commit8e33f09bae134908b0cb5b8e46d4e789398b3df4
tree2787ecd899d4f5970a5b499783eb1cb205120b9c
parentba4751012fb3dd440fb292a3a4a3dae3228eb4cc
OCPayloadConvert cbor payload size

CBOR payload conversion by default is set to 255. When memory failure occurs it
uses encoder->ptr - encoder->end to increase the payload size.

The recent error checking resulted in returning immediately and that result in
encoder->end having a wrong value set. Close container results in setting end
encoder->value correctly.

Changes include to not exit immediately if it fails. It fails after close container
call.

It also introduces the max size of the payload. It is set of 1530, which is based on
6 times of default paylaod size.

Change-Id: I9448a5beea9d3f906dd5f5647d0b6adcbea2cb37
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5491
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/stack/src/ocpayloadconvert.c