Mercurial > hg > nginx-quic
comparison src/event/ngx_event_quic.c @ 7871:df18ae7161b8 quic
Assorted fixes.
Found by Clang Static Analyzer.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 20 May 2020 15:36:24 +0300 |
parents | e169cce912c7 |
children | 1245e274b9ba |
comparison
equal
deleted
inserted
replaced
7870:e169cce912c7 | 7871:df18ae7161b8 |
---|---|
1079 ngx_buf_t b; | 1079 ngx_buf_t b; |
1080 ngx_connection_t *c; | 1080 ngx_connection_t *c; |
1081 ngx_quic_connection_t *qc; | 1081 ngx_quic_connection_t *qc; |
1082 static u_char buf[NGX_QUIC_DEFAULT_MAX_PACKET_SIZE]; | 1082 static u_char buf[NGX_QUIC_DEFAULT_MAX_PACKET_SIZE]; |
1083 | 1083 |
1084 ngx_memzero(&b, sizeof(ngx_buf_t)); | |
1084 b.start = buf; | 1085 b.start = buf; |
1085 b.end = buf + sizeof(buf); | 1086 b.end = buf + sizeof(buf); |
1086 b.pos = b.last = b.start; | 1087 b.pos = b.last = b.start; |
1087 b.memory = 1; | 1088 b.memory = 1; |
1088 | 1089 |
1435 ngx_quic_send_ctx_t *ctx; | 1436 ngx_quic_send_ctx_t *ctx; |
1436 ngx_quic_connection_t *qc; | 1437 ngx_quic_connection_t *qc; |
1437 static u_char buf[NGX_QUIC_DEFAULT_MAX_PACKET_SIZE]; | 1438 static u_char buf[NGX_QUIC_DEFAULT_MAX_PACKET_SIZE]; |
1438 | 1439 |
1439 c->log->action = "retrying quic connection"; | 1440 c->log->action = "retrying quic connection"; |
1440 | |
1441 qc = c->quic; | |
1442 | 1441 |
1443 if (ngx_buf_size(pkt->raw) < NGX_QUIC_MIN_INITIAL_SIZE) { | 1442 if (ngx_buf_size(pkt->raw) < NGX_QUIC_MIN_INITIAL_SIZE) { |
1444 ngx_log_error(NGX_LOG_INFO, c->log, 0, | 1443 ngx_log_error(NGX_LOG_INFO, c->log, 0, |
1445 "quic UDP datagram is too small for initial packet"); | 1444 "quic UDP datagram is too small for initial packet"); |
1446 return NGX_OK; | 1445 return NGX_OK; |
3241 ngx_quic_connection_t *qc; | 3240 ngx_quic_connection_t *qc; |
3242 | 3241 |
3243 qc = c->quic; | 3242 qc = c->quic; |
3244 | 3243 |
3245 now = ngx_current_msec; | 3244 now = ngx_current_msec; |
3246 wait = 0; | |
3247 | 3245 |
3248 if (ngx_queue_empty(&ctx->sent)) { | 3246 if (ngx_queue_empty(&ctx->sent)) { |
3249 *waitp = 0; | 3247 *waitp = 0; |
3250 return NGX_OK; | 3248 return NGX_OK; |
3251 } | 3249 } |
3947 | 3945 |
3948 qc = c->quic; | 3946 qc = c->quic; |
3949 | 3947 |
3950 if (frame->data) { | 3948 if (frame->data) { |
3951 ngx_free(frame->data); | 3949 ngx_free(frame->data); |
3950 frame->data = NULL; | |
3952 } | 3951 } |
3953 | 3952 |
3954 ngx_queue_insert_head(&qc->free_frames, &frame->queue); | 3953 ngx_queue_insert_head(&qc->free_frames, &frame->queue); |
3955 | 3954 |
3956 #ifdef NGX_QUIC_DEBUG_FRAMES_ALLOC | 3955 #ifdef NGX_QUIC_DEBUG_FRAMES_ALLOC |