diff src/event/ngx_event_quic_transport.h @ 7751:f85749b60e58 quic

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()
author Vladimir Homutov <vl@nginx.com>
date Thu, 26 Mar 2020 12:11:50 +0300
parents f388c0ad3477
children c7185bc5b4d9
line wrap: on
line diff
--- a/src/event/ngx_event_quic_transport.h
+++ b/src/event/ngx_event_quic_transport.h
@@ -255,11 +255,14 @@ typedef struct {
 u_char *ngx_quic_error_text(uint64_t error_code);
 
 ngx_int_t ngx_quic_parse_long_header(ngx_quic_header_t *pkt);
-size_t ngx_quic_create_long_header(ngx_quic_header_t *pkt, ngx_str_t *out,
+size_t ngx_quic_create_long_header(ngx_quic_header_t *pkt, u_char *out,
     size_t pkt_len, u_char **pnp);
 
 ngx_int_t ngx_quic_parse_short_header(ngx_quic_header_t *pkt,
     ngx_str_t *dcid);
+size_t ngx_quic_create_short_header(ngx_quic_header_t *pkt, u_char *out,
+    size_t pkt_len, u_char **pnp);
+
 ngx_int_t ngx_quic_parse_initial_header(ngx_quic_header_t *pkt);
 ngx_int_t ngx_quic_parse_handshake_header(ngx_quic_header_t *pkt);