Mercurial > hg > nginx-quic
comparison src/event/ngx_event_quic_transport.c @ 7835:2a6e91a1691d quic
TODOs cleanup in transport.
We always generate stream frames that have length. The 'len' member is used
during parsing incoming frames and can be safely ignored when generating
output.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Thu, 23 Apr 2020 12:25:00 +0300 |
parents | 05b8dd5d9f7e |
children | 2f900ae486bc |
comparison
equal
deleted
inserted
replaced
7834:05b8dd5d9f7e | 7835:2a6e91a1691d |
---|---|
1265 ngx_quic_create_stream(u_char *p, ngx_quic_stream_frame_t *sf) | 1265 ngx_quic_create_stream(u_char *p, ngx_quic_stream_frame_t *sf) |
1266 { | 1266 { |
1267 size_t len; | 1267 size_t len; |
1268 u_char *start; | 1268 u_char *start; |
1269 | 1269 |
1270 if (!sf->len) { | |
1271 #if 0 | |
1272 ngx_log_error(NGX_LOG_INFO, log, 0, | |
1273 "attempt to generate a stream frame without length"); | |
1274 #endif | |
1275 // XXX: handle error in caller | |
1276 return NGX_ERROR; | |
1277 } | |
1278 | |
1279 if (p == NULL) { | 1270 if (p == NULL) { |
1280 len = ngx_quic_varint_len(sf->type); | 1271 len = ngx_quic_varint_len(sf->type); |
1281 | 1272 |
1282 if (sf->off) { | 1273 if (sf->off) { |
1283 len += ngx_quic_varint_len(sf->offset); | 1274 len += ngx_quic_varint_len(sf->offset); |
1343 | 1334 |
1344 switch (id) { | 1335 switch (id) { |
1345 case NGX_QUIC_TP_ORIGINAL_CONNECTION_ID: | 1336 case NGX_QUIC_TP_ORIGINAL_CONNECTION_ID: |
1346 case NGX_QUIC_TP_STATELESS_RESET_TOKEN: | 1337 case NGX_QUIC_TP_STATELESS_RESET_TOKEN: |
1347 case NGX_QUIC_TP_PREFERRED_ADDRESS: | 1338 case NGX_QUIC_TP_PREFERRED_ADDRESS: |
1348 // TODO | 1339 /* TODO: implement */ |
1349 return NGX_DECLINED; | 1340 return NGX_DECLINED; |
1350 } | 1341 } |
1351 | 1342 |
1352 switch (id) { | 1343 switch (id) { |
1353 | 1344 |