Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 2.62 KB

CsProtocol-decoding.md

File metadata and controls

50 lines (36 loc) · 2.62 KB

SDK protocol decoder

Payload Decoder Implementation

1DS C++ SDK provides a built-in protocol decoder for the following formats:

  • Package of Records - either compressed or uncompressed HTTP post body containing binary-serialized events
  • Common Schema Record

The decoder consists of:

Decoder requires zlib and json.hpp libraries to be present in the build. Compact SDK build that do not include these libs cannot provide the event decoding functionality.

Callback function in user code that implements a transform from Common Schema Record must include CsProtocol_types.hpp Note that the Common Schema Record type does not provide ABI stability and may change release over release without further notice. User code has to be compiled with matching definition of the Common Schema Record. This is advanced functionality, usage of that implies a good understanding of SDK debug / event callback mechanism and is limited to applications and SDKs that compile 1DS C++ SDK from source. It is not recommended for an application that dynamically loads the SDK as a prebuilt module to rely on payload decoder due to no ABI-stability guarantee.

Payload Decoder usage example

Please refer to usage examples:

Decoder input limits

Diagnostic request decoding rejects inputs larger than 64 MiB, including compressed input and the inflated output. Inflation uses a fixed-size work buffer and stops before growing the output beyond that limit; it does not estimate output size from a presumed compression ratio.

Binary container counts must fit the remaining encoded input (at least one byte per sequence element or two bytes per map entry). Impossible counts are rejected before generated readers allocate their containers; no separate fixed element-count or record-count limit is imposed. Record-boundary scanning reads the request in place and copies only each individual record, so scanning and input copying are linear in request size. Decoding failure returns false rather than reporting a partial request as success; partial inflation output must not be used after a failed call.

These diagnostic limits do not change the event submission API or its configured serialized-event size policy.