summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_main_process.c
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2023-03-13 23:43:12 +0000
committerAndrew Clayton <a.clayton@nginx.com>2023-03-14 17:07:08 +0000
commit172ceba5b60d02cfc3acfb0feb88f415e7837092 (patch)
tree8af64f45baecc08d129e658c36e4e0ef06b75257 /src/nxt_main_process.c
parent28bdeec614d21d0ff2309431354e8cc389aac208 (diff)
downloadunit-172ceba5b60d02cfc3acfb0feb88f415e7837092.tar.gz
unit-172ceba5b60d02cfc3acfb0feb88f415e7837092.tar.bz2
Router: More accurately allocate request buffer memory.
In nxt_router_prepare_msg() we create a buffer (nxt_unit_request_t *req) that gets sent to an application process that contains details about a client request. This buffer was always a little larger than needed due to allocating space for the remote address _and_ port and the local address _and_ port. We also allocate space for the local port separately. ->{local,remote}->length includes the port number and ':' and also the '[]' for IPv6. E.g [2001:db8::1]:8080 ->{local,remote}->address_length represents the length of the unadorned IP address. E.g 2001:db8::1 Update the buffer size so that we only allocate what is actually needed. Suggested-by: Zhidao HONG <z.hong@f5.com> Cc: Zhidao HONG <z.hong@f5.com> Reviewed-by: Zhidao HONG <z.hong@f5.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/nxt_main_process.c')
0 files changed, 0 insertions, 0 deletions