Mercurial > hg > nginx
comparison src/event/ngx_event_quic.c @ 8205:a5423632d67b quic
Added more transport parameters.
Needed for client to start sending streams.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Wed, 11 Mar 2020 15:43:23 +0300 |
parents | 9e0c30e1f7fb |
children | 8d6ac639feac |
comparison
equal
deleted
inserted
replaced
8204:9e0c30e1f7fb | 8205:a5423632d67b |
---|---|
1489 { | 1489 { |
1490 int n, sslerr; | 1490 int n, sslerr; |
1491 ngx_ssl_conn_t *ssl_conn; | 1491 ngx_ssl_conn_t *ssl_conn; |
1492 ngx_quic_connection_t *qc; | 1492 ngx_quic_connection_t *qc; |
1493 | 1493 |
1494 /* STUB: initial_max_streams_uni=3, active_connection_id_limit=5 */ | 1494 static const uint8_t params[] = |
1495 static const uint8_t params[12] = "\x00\x0a\x00\x0e\x00\x01\x05\x00\x09\x00\x01\x03"; | 1495 "\x00\x29" /* parameters length: 41 bytes */ |
1496 "\x00\x0e\x00\x01\x05" /* active connection id limit: 5 */ | |
1497 "\x00\x04\x00\x04\x80\x98\x96\x80" /* initial max data = 10000000 */ | |
1498 "\x00\x09\x00\x01\x03" /* initial max streams uni: 3 */ | |
1499 "\x00\x08\x00\x01\x10" /* initial max streams bidi: 16 */ | |
1500 "\x00\x05\x00\x02\x40\xff" /* initial max stream bidi local: 255 */ | |
1501 "\x00\x06\x00\x02\x40\xff" /* initial max stream bidi remote: 255 */ | |
1502 "\x00\x07\x00\x02\x40\xff"; /* initial max stream data uni: 255 */ | |
1496 | 1503 |
1497 qc = c->quic; | 1504 qc = c->quic; |
1498 | 1505 |
1499 if (ngx_ssl_create_connection(qc->ssl, c, NGX_SSL_BUFFER) != NGX_OK) { | 1506 if (ngx_ssl_create_connection(qc->ssl, c, NGX_SSL_BUFFER) != NGX_OK) { |
1500 return NGX_ERROR; | 1507 return NGX_ERROR; |
1501 } | 1508 } |
1502 | 1509 |
1503 ssl_conn = c->ssl->connection; | 1510 ssl_conn = c->ssl->connection; |
1504 | 1511 |
1505 if (SSL_set_quic_transport_params(ssl_conn, params, sizeof(params)) == 0) { | 1512 if (SSL_set_quic_transport_params(ssl_conn, params, sizeof(params) - 1) == 0) { |
1506 ngx_log_error(NGX_LOG_INFO, c->log, 0, | 1513 ngx_log_error(NGX_LOG_INFO, c->log, 0, |
1507 "SSL_set_quic_transport_params() failed"); | 1514 "SSL_set_quic_transport_params() failed"); |
1508 return NGX_ERROR; | 1515 return NGX_ERROR; |
1509 } | 1516 } |
1510 | 1517 |