Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19384

Some of protocol header implementation examples use 8 bytes for length

    XMLWordPrintable

Details

    • Team A
    • Sprint 77 (Jun 2021), Sprint 78 (Jul 2021), Sprint 79 (Aug 2021), Sprint 80 (Sep 2021), Sprint 81 (Oct 2021), Sprint 82 (Nov 2021), Sprint 83 (Dec 2021), Sprint 84 (Jan 2022), Sprint 85 (Feb 2022), Sprint 86 (Mar 2022), Sprint 87 (Apr 2022), Sprint 88 (May 2022)
    • 0.125

    Description

      Some of code examples here serialize data length as 8 bytes, e.g.

      $packet = "ZBXD\1" . pack('P', strlen($data)) . $data;
      

      according to the old protocol specification:

      <DATALEN> - data length (8 bytes). 1 will be formatted as 01/00/00/00/00/00/00/00 (eight bytes, 64 bit number in little-endian format)
      

      Nowadays data length is supposed to be 4 bytes and another 4 bytes are "reserved":

      <DATALEN> - data length (4 bytes). 1 will be formatted as 01/00/00/00 (four bytes, 32 bit number in little-endian format).
      <RESERVED> - reserved for protocol extensions (4 bytes).
      

      P.S. It also says that

      When compression is enabled (0x02 flag) the <RESERVED> bytes contains uncompressed data size, 32 bit number in little-endian format.

      ...but does not say what <RESERVED> bytes should be when compression is not enabled.

      P.P.S. Use of <code> seems inappropriate to list parts of protocol header and looks a bit ugly. A list or a table would look better.

      Attachments

        Activity

          People

            martins-v Martins Valkovskis
            cyclone Glebs Ivanovskis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: