comparison src/event/ngx_event_quic_transport.h @ 8285: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
comparison
equal deleted inserted replaced
8284:2935a11c55b6 8285:f85749b60e58
253 253
254 254
255 u_char *ngx_quic_error_text(uint64_t error_code); 255 u_char *ngx_quic_error_text(uint64_t error_code);
256 256
257 ngx_int_t ngx_quic_parse_long_header(ngx_quic_header_t *pkt); 257 ngx_int_t ngx_quic_parse_long_header(ngx_quic_header_t *pkt);
258 size_t ngx_quic_create_long_header(ngx_quic_header_t *pkt, ngx_str_t *out, 258 size_t ngx_quic_create_long_header(ngx_quic_header_t *pkt, u_char *out,
259 size_t pkt_len, u_char **pnp); 259 size_t pkt_len, u_char **pnp);
260 260
261 ngx_int_t ngx_quic_parse_short_header(ngx_quic_header_t *pkt, 261 ngx_int_t ngx_quic_parse_short_header(ngx_quic_header_t *pkt,
262 ngx_str_t *dcid); 262 ngx_str_t *dcid);
263 size_t ngx_quic_create_short_header(ngx_quic_header_t *pkt, u_char *out,
264 size_t pkt_len, u_char **pnp);
265
263 ngx_int_t ngx_quic_parse_initial_header(ngx_quic_header_t *pkt); 266 ngx_int_t ngx_quic_parse_initial_header(ngx_quic_header_t *pkt);
264 ngx_int_t ngx_quic_parse_handshake_header(ngx_quic_header_t *pkt); 267 ngx_int_t ngx_quic_parse_handshake_header(ngx_quic_header_t *pkt);
265 268
266 ssize_t ngx_quic_parse_frame(ngx_quic_header_t *pkt, u_char *start, u_char *end, 269 ssize_t ngx_quic_parse_frame(ngx_quic_header_t *pkt, u_char *start, u_char *end,
267 ngx_quic_frame_t *frame); 270 ngx_quic_frame_t *frame);