comparison src/core/ngx_proxy_protocol.c @ 8073:aa663cc2a77d

Added type cast to ngx_proxy_protocol_parse_uint16(). The cast is added to make ngx_proxy_protocol_parse_uint16() similar to ngx_proxy_protocol_parse_uint32().
author Roman Arutyunyan <arut@nginx.com>
date Tue, 27 Sep 2022 11:31:16 +0400
parents cca4c8a715de
children 17d6a537fb1b
comparison
equal deleted inserted replaced
8072:cca4c8a715de 8073:aa663cc2a77d
11 11
12 #define NGX_PROXY_PROTOCOL_AF_INET 1 12 #define NGX_PROXY_PROTOCOL_AF_INET 1
13 #define NGX_PROXY_PROTOCOL_AF_INET6 2 13 #define NGX_PROXY_PROTOCOL_AF_INET6 2
14 14
15 15
16 #define ngx_proxy_protocol_parse_uint16(p) ((p)[0] << 8 | (p)[1]) 16 #define ngx_proxy_protocol_parse_uint16(p) \
17 ( ((uint16_t) (p)[0] << 8) \
18 + ( (p)[1]) )
17 19
18 #define ngx_proxy_protocol_parse_uint32(p) \ 20 #define ngx_proxy_protocol_parse_uint32(p) \
19 ( ((uint32_t) (p)[0] << 24) \ 21 ( ((uint32_t) (p)[0] << 24) \
20 + ( (p)[1] << 16) \ 22 + ( (p)[1] << 16) \
21 + ( (p)[2] << 8) \ 23 + ( (p)[2] << 8) \