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>