Welcome! Log In Create A New Profile

Advanced

[nginx] Added type cast to ngx_proxy_protocol_parse_uint16().

Roman Arutyunyan
October 12, 2022 10:38AM
details: https://hg.nginx.org/nginx/rev/aa663cc2a77d
branches:
changeset: 8073:aa663cc2a77d
user: Roman Arutyunyan <arut@nginx.com>
date: Tue Sep 27 11:31:16 2022 +0400
description:
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().

diffstat:

src/core/ngx_proxy_protocol.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r cca4c8a715de -r aa663cc2a77d src/core/ngx_proxy_protocol.c
--- a/src/core/ngx_proxy_protocol.c Wed Oct 12 16:58:16 2022 +0400
+++ b/src/core/ngx_proxy_protocol.c Tue Sep 27 11:31:16 2022 +0400
@@ -13,7 +13,9 @@
#define NGX_PROXY_PROTOCOL_AF_INET6 2


-#define ngx_proxy_protocol_parse_uint16(p) ((p)[0] << 8 | (p)[1])
+#define ngx_proxy_protocol_parse_uint16(p) \
+ ( ((uint16_t) (p)[0] << 8) \
+ + ( (p)[1]) )

#define ngx_proxy_protocol_parse_uint32(p) \
( ((uint32_t) (p)[0] << 24) \
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[nginx] Added type cast to ngx_proxy_protocol_parse_uint16().

Roman Arutyunyan 205 October 12, 2022 10:38AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 136
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready