diff options
author | Andris Zeila <andris.zeila@zabbix.com> | 2018-03-21 17:55:04 +0300 |
---|---|---|
committer | Andris Zeila <andris.zeila@zabbix.com> | 2018-03-21 17:55:04 +0300 |
commit | d1d19404bae61eed5e0970dad756abc64bea7aaf (patch) | |
tree | 2840890432afb899b4b1f41b961119ed1593dedd /include/comms.h | |
parent | 733033a55254a414a6931efa419c764d94840861 (diff) |
.......PS. [ZBXNEXT-4411] added compression to server-proxy data exchange
Diffstat (limited to 'include/comms.h')
-rw-r--r-- | include/comms.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/comms.h b/include/comms.h index 66e7977dcb7..ca0076d4ee1 100644 --- a/include/comms.h +++ b/include/comms.h @@ -103,6 +103,7 @@ typedef struct /* Peer host DNS name or IP address for diagnostics (after TCP connection is established). */ /* TLS connection may be shut down at any time and it will not be possible to get peer IP address anymore. */ char peer[MAX_ZBX_DNSNAME_LEN + 1]; + int protocol; } zbx_socket_t; @@ -116,7 +117,7 @@ int zbx_tcp_connect(zbx_socket_t *s, const char *source_ip, const char *ip, unsi unsigned int tls_connect, const char *tls_arg1, const char *tls_arg2); #define ZBX_TCP_PROTOCOL 0x01 -#define ZBX_TCP_COMPONENT_VERSION 0x02 +#define ZBX_TCP_COMPRESS 0x02 #define ZBX_TCP_SEC_UNENCRYPTED 1 /* do not use encryption with this socket */ #define ZBX_TCP_SEC_TLS_PSK 2 /* use TLS with pre-shared key (PSK) with this socket */ @@ -182,13 +183,14 @@ void zbx_udp_close(zbx_socket_t *s); #define ZBX_DEFAULT_AGENT_PORT_STR "10050" #define ZBX_DEFAULT_SERVER_PORT_STR "10051" -int zbx_send_response_ext(zbx_socket_t *sock, int result, const char *info, int protocol, int timeout); +int zbx_send_response_ext(zbx_socket_t *sock, int result, const char *info, const char *version, int protocol, + int timeout); #define zbx_send_response(sock, result, info, timeout) \ - zbx_send_response_ext(sock, result, info, ZBX_TCP_PROTOCOL, timeout) + zbx_send_response_ext(sock, result, info, NULL, ZBX_TCP_PROTOCOL, timeout) #define zbx_send_proxy_response(sock, result, info, timeout) \ - zbx_send_response_ext(sock, result, info, ZBX_TCP_PROTOCOL | ZBX_TCP_COMPONENT_VERSION , timeout) + zbx_send_response_ext(sock, result, info, ZABBIX_VERSION, ZBX_TCP_PROTOCOL | ZBX_TCP_COMPRESS, timeout) int zbx_recv_response(zbx_socket_t *sock, int timeout, char **error); |