]> git.kaiwu.me - nginx.git/commit
Removed memory allocations from encryption code.
authorVladimir Homutov <vl@nginx.com>
Thu, 26 Mar 2020 09:11:50 +0000 (12:11 +0300)
committerVladimir Homutov <vl@nginx.com>
Thu, 26 Mar 2020 09:11:50 +0000 (12:11 +0300)
commit715d8a250b58c10d87fa44b63367a30ae0bf47c9
treed1c5487202cb416d6a717a6aeb0de03cdc6107ec
parentbcd54c26431cca5322c2413e88cbbf3097230ea4
Removed memory allocations from encryption code.

 + ngx_quic_encrypt():
     - no longer accepts pool as argument
     - pkt is 1st arg
     - payload is passed as pkt->payload
     - performs encryption to the specified static buffer

 + ngx_quic_create_long/short_packet() functions:
    - single buffer for everything, allocated by caller
    - buffer layout is: [ ad | payload | TAG ]
      the result is in the beginning of buffer with proper length
    - nonce is calculated on stack
    - log is passed explicitly, pkt is 1st arg
    - no more allocations inside

 + ngx_quic_create_long_header():
    - args changed: no need to pass str_t

 + added ngx_quic_create_short_header()
src/event/ngx_event_quic.c
src/event/ngx_event_quic_protection.c
src/event/ngx_event_quic_protection.h
src/event/ngx_event_quic_transport.c
src/event/ngx_event_quic_transport.h