manual:appendix:protocols:header_datalen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:appendix:protocols:header_datalen [2019/05/14 07:15]
vso ZBX-16123 fixed bash script
manual:appendix:protocols:header_datalen [2020/08/06 06:53] (current)
marinagen [ZBX-18175] protocol limit 1 GB
Line 13: Line 13:
 When compression is enabled (0x02 flag) the <​RESERVED>​ bytes contains uncompressed data size, 32 bit number in little-endian format. When compression is enabled (0x02 flag) the <​RESERVED>​ bytes contains uncompressed data size, 32 bit number in little-endian format.
  
-To not exhaust memory (potentially) ​Zabbix protocol ​is limited to accept only 128MB in one connection.+Zabbix protocol ​has 1GB packet size limit per connection.
  
 === Implementation === === Implementation ===
Line 23: Line 23:
 printf -v LENGTH '​%016x'​ "​${#​DATA}"​ printf -v LENGTH '​%016x'​ "​${#​DATA}"​
 PACK=""​ PACK=""​
-for i in {14..0..-2}; do PACK="​$PACK\\x${LENGTH:​$i:​2}";​ done+for (( i=14; i>=0; i-=)); do PACK="​$PACK\\x${LENGTH:​$i:​2}";​ done
 printf "​ZBXD\1$PACK%s"​ "​$DATA"​ printf "​ZBXD\1$PACK%s"​ "​$DATA"​
 </​code>​| </​code>​|