comparison src/event/ngx_event_quic.c @ 8371:9d9531431c8c quic

Removed outdated/incorrect comments and fixed style. - we need transport parameters early to get packet size limits at least.
author Vladimir Homutov <vl@nginx.com>
date Wed, 29 Apr 2020 14:45:55 +0300
parents 262396242352
children 2a94aaa70b33
comparison
equal deleted inserted replaced
8370:262396242352 8371:9d9531431c8c
377 qc = c->quic; 377 qc = c->quic;
378 378
379 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, 379 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
380 "quic ngx_quic_add_handshake_data"); 380 "quic ngx_quic_add_handshake_data");
381 381
382 /* XXX: obtain client parameters after the handshake? */
383 if (!qc->client_tp_done) { 382 if (!qc->client_tp_done) {
384 383
385 SSL_get_peer_quic_transport_params(ssl_conn, &client_params, 384 SSL_get_peer_quic_transport_params(ssl_conn, &client_params,
386 &client_params_len); 385 &client_params_len);
387 386
1064 "quic packet with zero flags, presumably" 1063 "quic packet with zero flags, presumably"
1065 " firefox padding, ignored"); 1064 " firefox padding, ignored");
1066 break; 1065 break;
1067 } 1066 }
1068 1067
1069 // TODO: check current state 1068 /* TODO: check current state */
1070 if (ngx_quic_long_pkt(pkt.flags)) { 1069 if (ngx_quic_long_pkt(pkt.flags)) {
1071 1070
1072 if (ngx_quic_pkt_in(pkt.flags)) { 1071 if (ngx_quic_pkt_in(pkt.flags)) {
1073 rc = ngx_quic_initial_input(c, &pkt); 1072 rc = ngx_quic_initial_input(c, &pkt);
1074 1073
1722 return NGX_OK; 1721 return NGX_OK;
1723 } 1722 }
1724 1723
1725 ngx_log_error(NGX_LOG_INFO, c->log, 0, 1724 ngx_log_error(NGX_LOG_INFO, c->log, 0,
1726 "quic ACK for the packet not in sent queue "); 1725 "quic ACK for the packet not in sent queue ");
1727 // TODO: handle error properly: PROTOCOL VIOLATION? 1726 /* TODO: handle error properly: PROTOCOL VIOLATION */
1728 return NGX_ERROR; 1727 return NGX_ERROR;
1729 } 1728 }
1730 1729
1731 if (!qc->push.timer_set) { 1730 if (!qc->push.timer_set) {
1732 ngx_post_event(&qc->push, &ngx_posted_events); 1731 ngx_post_event(&qc->push, &ngx_posted_events);
2576 ngx_quic_free_frame(c, f); 2575 ngx_quic_free_frame(c, f);
2577 } while (1); 2576 } while (1);
2578 } 2577 }
2579 2578
2580 2579
2581 /* pack a group of frames [start; end) into memory p and send as single packet */
2582 static ngx_int_t 2580 static ngx_int_t
2583 ngx_quic_send_frames(ngx_connection_t *c, ngx_queue_t *frames) 2581 ngx_quic_send_frames(ngx_connection_t *c, ngx_queue_t *frames)
2584 { 2582 {
2585 ssize_t len; 2583 ssize_t len;
2586 u_char *p; 2584 u_char *p;