CHANGELOG revision 7a8b2ece
12019-12-23 2 - 2.8.0 3 - [FEATURE] Add support for Q050. 4 - [OPTIMIZATION] Reduce mallocs in gQUIC handshake. 5 - [BUGFIX] Disable redo of failed STREAM frame insertion with debug 6 logging. 7 82019-12-18 9 - 2.7.3 10 - [DEBUG] Further dedup next advisory tick messages when reason is 11 the same. 12 - [BUGFIX] Update size of `a` array in TP struct. Fixes (benign) 13 GitHub bug #94. 14 - Use Cubic by default again instead of BBR, as it delivers more 15 consistent performance. 16 172019-12-11 18 - 2.7.2 19 - [BUGFIX] Send controller: update scheduled bytes when DCID length 20 changes (IETF client). 21 - [BUGFIX] Drop alarm check from sanity test. It no longer works now 22 that we use loss chains. 23 - [PORTABILITY] Fix build on Alpine Linux. 24 - [PORTABILITY] Fix build using XCode. 25 - Client initial DCID length: use RAND_bytes() instead of rand(3). 26 - Add unit tests for connection min heap. 27 - [DEBUG] Log CID in gQUIC handshake module 28 - [DEBUG] Turn on extra checks for IETF client send controller. 29 - [DEBUG] Dedup next advisory tick messages when reason is IDLE timer. 30 - [DEBUG] QPACK decoder handler: log header error code. 31 322019-12-05 33 - 2.7.1 34 - [BUGFIX] client: don't call ignore_init() in middle of batch send. 35 ignore_init() makes an assumption that the send controller has access 36 to all outgoing packets. This change wraps a few IETF full connection 37 methods to delay calling ignore_init() until the engine returns all 38 outgoing packets that were batched. 39 - [BUGFIX] set errno to EAGAIN if sendmmsg() can't send all of them. 40 This needs to be done because the value of errno may be lost on 41 some platforms. 42 - [BUGFIX] Typo that set all bits in sm_qflags lead to crashes. 43 - [BUGFIX] Do not cancel header block processing after failure, as 44 QPACK releases the reference in that case. 45 - [CLEANUP] IETF encrypt: replace assert(0) with a warning. 46 - Several small improvements to the test server. 47 482019-11-27 49 - 2.7.0 50 - [API, FEATURE] Close connection immediately when ea_packets_out() 51 fails with errno != EAGAIN. The API change is that errno is now 52 examined. Make sure to set it if using something other than 53 sendmsg() to send packets. 54 - [CLEANUP] Immediate close logic in IETF full conn. 55 - [CLEANUP] Fix bogus warning about uninitialized `pair' variable. 56 572019-11-22 58 - 2.6.7 59 - [FEATURE] Implement the QL extension (offered by default). 60 - [BUGFIX] Abort when encountering unexpected HTTP/3 frames. 61 - [BUGFIX] Acknowledge (QPACK) HTTP/3 trailers correctly. 62 - [DEBUG] Turn on debug message for next advisory tick. 63 642019-11-20 65 - 2.6.6 66 - [BUGFIX] Using HTTP/3 to HTTP/1.x converter. 67 - [BUGFIX] Truncate log messages instead of throwing them away. 68 692019-11-15 70 - 2.6.5 71 - [BUGFIX] High priority buffered packet queue length. 72 - [BUGFIX] Rain time calculation: max_ack_delay is in milliseconds. 73 742019-11-12 75 - 2.6.3 76 - [BUGFIX] Close DATA frames with empty payload correctly. 77 782019-11-11 79 - 2.6.2 80 - [BUGFIX] SCID!=ODCID rule applies to Retry packets, not regular 81 packets. 82 - [BUGFIX] Zero-RTT: BoringSSL no longer flips read/write secrets. 83 - [BUGFIX] Truncate ACK frame rather instead of aborting IETF 84 connection. 85 - [BUGFIX] Client: don't send duplicate reset tokens. 86 - [BUGFIX] Remove invalid assertion in H3 framing code. 87 - Silence a warning in send ctl by restructuring switch() statement. 88 892019-11-08 90 - 2.6.1 91 - [BUGFIX] set retry token on all resubmitted packets. 92 - Event log: log sent packet flags. In particular, this allows one 93 to see whether token was sent. 94 - Don't migrate client if es_allow_migration is false. 95 962019-11-07 97 - 2.6.0 98 - [FEATURE] QUIC and HTTP/3 Internet Draft 24 support 99 1002019-11-07 101 - 2.5.2 102 - [BUGFIX] argument order to gQUIC client constructor. Regression 103 introduced in 2.5.0. 104 - [BUGFIX] split buffered packet error recovery: destroy the correct 105 packet. 106 1072019-11-04 108 - 2.5.1 109 - [BUGFIX] Fix double-free when emptying a packet number space. 110 - [BUGFIX] http_server: fix md5sum handler: handle EOF correctly. 111 - [BUGFIX] Use random values in bits 4 and 5 of the first byte of 112 verneg packets (regression introduced in 2.5.0). 113 - [OPTIMIZATION] Don't compile in expensive attq checks by default. 114 - [OPTIMIZATION] http_server: compile regexes only once. 115 1162019-10-31 117 - 2.5.0 118 - [API] lsquic_engine_connect() can now be passed QUIC version to use. 119 - [OPTIMIZATION] Queue opportunistic ACKs if there is data to be sent. 120 - [BUGFIX] Don't evict streams from priority iterator if there is 121 only one queue. 122 - [OPTIMIZATION, BUGFIX] Several other optimizations and bug fixes. 123 - Use ls-qpack v0.10.7. 124 1252019-10-24 126 - 2.4.10 127 - [BUGFIX] IETF QUIC server: fix uninitialized variable use. 128 - [BUGFIX] make sure TLSv1.3 is not disabled in SSL object. 129 - [BUGFIX] Use issuer name and serial number to cache certs (SKID 130 values are not unique). 131 - [BUGFIX] Always set the idle alarm in IETF connection so that it 132 can time out. 133 - Use ls-qpack v0.10.6, as it silences some warnings. 134 1352019-10-21 136 - 2.4.8 137 - [OPTIMIZATION, BUGFIX] Use ls-qpack v0.10.5. 138 1392019-10-15 140 - 2.4.7 141 - Add echo client and server to the distibution. 142 - Add MD5 client and server to the distibution. 143 - Fix http_client: check command-line arguments better, prevent crash. 144 - Fix IETF conn: can_write_ack() should only care about APP PNS. 145 - Client: delay stream creation until handshake succeds. 146 - Reset HTTP stream whose write end is closed prematurely. 147 - Fix tickable(): mirror behavior of tick() wrt buffered packets. 148 - Log reason why engine is tickable. 149 1502019-10-11 151 - 2.4.6 152 - Minor code cleanup and logging improvements. 153 - Server and client programs: include library version (e.g. 2.4.6) 154 into `server' and `user-agent' headers. 155 1562019-10-08 157 - 2.4.5 158 - [OPTIMIZATION]: flush encoder stream only when necessary. 159 - [BUGFIX] Use ls-qpack v0.10.2 for new API -- and for a bug fix. 160 - [BUGFIX] Typo in IETF conn SETTINGS writer. 161 - Use latest BoringSSL. 162 1632019-10-08 164 - 2.4.4 165 - [API] Add lsquic_alpn2ver() to aid parsing Alt-Svc header. 166 - [BUGFIX] NULL dereference when H3 frame header would be split. 167 - [BUGFIX] Do not close fixed-size H3 frame prematurely. 168 - [BUGFIX] Allow PING frames in IETF mini conn. 169 - [BUGFIX] Mini conns: don't send any packets after receiving 170 CONNECTION_CLOSE. 171 - [BUGFIX] Client migration: reserve slot for DCID from transport params. 172 - [BUGFIX] Allow max_early_data_size=0 -- early_data might not be there. 173 - [BUGFIX] Use an invalid stream number to reset BPT cache (zero is now a 174 valid stream number). 175 - [SPEC] Use FINAL_SIZE_ERROR when FIN mismatch is detected. 176 - [OPTIMIZATION] Closed connection only gets one chance to send packets. 177 - [OPTIMIZATION] Flush headers stream before packetizing stream data. 178 - [OPTIMIZATION] process QPACK encoder STREAM frames immediately. 179 - Update ls-qpack to v0.10.1. 180 1812019-09-30 182 - 2.4.3 183 - Add GQUIC versions to the list of h3 ALPNs for Alt-Svc header. 184 For example, h3-Q043. Chrome will switch to using this format at 185 some point in the future. 186 - [BUGFIX] Send correct value in max_streams_uni transport param 187 - [SPEC] Abort IETF QUIC connection if max_early_data_size is not set 188 to 0xFFFFFFFF 189 1902019-09-23 191 - 2.4.2 192 - [BUGFIX] H3 framing: fix zero-byte write when space is available 193 - [BUGFIX] Don't send STREAM frame when incoming unidirectgional stream 194 is closed 195 - [BUGFIX] Cancel all pending writes by stream reset by a GOAWAY 196 - [BUGFIX] Fix use-after-free in IETF full conn 197 - [OPTIMIZATION] Wait for session tickets for two seconds and then drop 198 SSL object and crypto streams. 199 2002019-09-18 201 - 2.4.0 202 - [FEATURE] QUIC and HTTP/3 Internet Draft 23 support 203 2042019-09-13 205 - 2.3.1 206 - [BUGFIX] Fix memory leaks 207 - [BUGFIX] Fix unit tests 208 2092019-09-12 210 - 2.3.0 211 - [FEATURE] BBR congestion control is on by default 212 - [BUGFIX] BBR app-limited logic 213 - [BUGFIX] Fix uninitialized warnings in IETF 214 - [BUGFIX] Update ls-qpack to v0.9.14 215 - [CLEANUP] Code cleanup 216 2172019-09-11 218 - 2.2.0 219 - [FEATURE] Server code is included in the library 220 - [FEATURE] IETF QUIC and HTTP/3 Support (ID-22) 221 2222019-05-13 223 - 1.21.2 224 - [OPTIMIZATION] HPACK: use history to improve compression performance 225 2262019-05-06 227 - 1.21.1 228 - [BUGFIX] If FIN or RST not received, don't delay stream destruction. 229 - [OPTIMIZATION] Speed up HPACK encoder by using same hash value to 230 search static and dynamic tables. 231 2322019-04-12 233 - 1.21.0 234 - [FEATURE] Add qlog log module. 235 2362019-04-01 237 - 1.20.0 238 - [FEATURE] Add support for Q046. 239 2402019-03-19 241 - 1.19.6 242 - [BUGFIX] Ensure that Largest Observed does not decrease in ACKs we 243 send. ACK frames placed in packets in buffered queues (optimization 244 introduced in 1.17.15) can be preceded by an ACK frame generated later. 245 In this case, the older ACK frame should not be sent out, as Chromium- 246 based servers flags decrease in the ACK frame's Largest Observed value 247 as an error. 248 2492019-03-05 250 - 1.19.5 251 - [BUGFIX] Use correct public key from PUBS based on KEXS index. 252 - [BUGFIX] Check flags before dispatching writes, avoiding assert. 253 - [BUGFIX] Set :scheme to "https" (instead of "HTTP"). 254 2552019-02-25 256 - 1.19.4 257 - [BUGFIX] Check buffer bounds when looking up version in 0-RTT blob. 258 - [BUGFIX] http_client: don't fetch 0-rtt info if handshake failed. 259 - Log number of pacer calls at DEBUG, rather than NOTICE, level. 260 2612019-02-18 262 - 1.19.3 263 - [BUGFIX] Q044: don't encode packet number in 6 bytes. Six-byte 264 packet number encoding does not exist in Q044. This fixes a 265 regression introduced in '[BUGFIX] Buffered packets can contain 266 ACK frames' -- we need to keep QUIC version in mind when selecting 267 the longest possible packet number encoding used for the buffered 268 packet that carries the ACK. 269 - [BUGFIX] Do not increase CWND when timeout occurs. 270 - http_client: support setting handshake timeout on command line. 271 Use -o handshake_to=timeout. 272 - http_client: use -k to connect UDP socket to pick up ICMP errors. 273 - http_client: allow pathless mode, when only handshake is performed 274 without issuing any requests. This can be done by simply not 275 specifying a -p flag on the command line. 276 2772019-02-11 278 - 1.19.2 279 - [BUGFIX] Begin negotiation with version provided in 0-RTT info. 280 - [BUGFIX] Version checking in zero_rtt deserialize function. 281 2822019-02-04 283 - 1.19.1 284 - [BUGFIX] Fix Windows build. 285 2862019-02-04 287 - 1.19.0 288 - [FEATURE, API Change] 0-RTT support. Add function to export 0-RTT 289 information; it can be supplied to a subsequent connect() call. 290 - [FEATURE] Add -0 flag to http_client to exercise 0-RTT support. 291 - [BUGFIX] Resuscitate the Windows build. 292 - [BUGFIX] Send HTTP settings (max header list size) if necessary. 293 - [BUGFIX] Buffered packets can contain ACK frames. 294 - [BUGFIX] Make packet writeable once all STREAM frames are elided. 295 - [BUGFIX] Fix potential null dereference when realloc fails. 296 - cmake: simplify build configuration. 297 2982019-01-28 299 - 1.18.0 300 - [API Change] Can specify clock granularity in engine settings. 301 - [BUGFIX] Pacer uses fixed clock granularity. Since the change on 302 2018-04-09, it is not necessary to try to approximate the next tick 303 time in the pacer: it can use fix clock granularity specified by 304 the user. 305 - [BUGFIX] Do not tick constantly before handshake is done. 306 - [BUGFIX] Do not exit tick prematurely: reuse packet with ACK. Even 307 if we cannot allocate *more* packets, we could still be able to write 308 to one already allocated. 309 - [BUGFIX] Do not schedule pacer if there are no lost packets. 310 3112019-01-17 312 - 1.17.15 313 - [BUGFIX] http_client: make sure only one read per on_read() callback 314 is performed in the header conversion bypass (-B) mode. 315 - http_client: with -E, assign random priority when stream is created. 316 - [OPTIMIZATION] On immediate write, place an ACK frame into the first 317 buffered packet if an ACK is queued. This reduces the number of 318 standalone ACK packets. 319 - [OPTIMIZATION] Allow placing more than one STREAM frame from the same 320 stream into an outgoing packet. This change minimizes the number of 321 buffered packets required to store several small HTTP messages by 322 virtue of allowing more than one STREAM frame from HEADERS stream in 323 the same packet. 324 - [OPTIMIZATION] Flush headers when writing to buffered packets. This 325 causes the headers to be written to the same buffered packet queue, 326 thereby improving packet utilization, especially for small HTTP 327 messages. 328 3292019-01-16 330 - 1.17.14 331 - [FEATURE] http_client can now collect stats: time to connect, TTFB, 332 time to download, requests per seconds, and bandwidth. See -t flag. 333 - [BUGFIX] http_client: -B, -K, and -r can be used at the same time. 334 - [BUGFIX] http_client: do not display cert chain before each request. 335 Now this is only done once per connection, if the handshake is 336 successful and -a option is given. 337 - [BUGFIX] Do not wait to dispatch on_close() after reading. If a 338 stream is scheduled to be closed after on_read() callback returns, 339 close it immediately instead of waiting until the end of the tick. 340 If client creates new request from on_close() event, they will be 341 processed in the same tick instead of waiting for the next one. 342 - [BUGFIX] HEADERS stream is critical: always treat it with highest 343 priority. 344 3452019-01-10 346 - 1.17.12 347 - [FEATURE] http_client can now issue parallel requests in the context 348 of a single connection. See -w option. 349 3502019-01-03 351 - 1.17.11 352 - Fix strict aliasing warning in optimized compilation. 353 3542018-12-27 355 - 1.17.10 356 - Fix the example program to be able to use parallel connections 357 again. (See the -n argument.) 358 3592018-12-18 360 - 1.17.9 361 - [BUGFIX] Engine: reduce minimum batch size from 256 to 4 362 3632018-12-10 364 - 1.17.8 365 - [BUGFIX] Fix compilation on FreeBSD and 32-bit Linux 366 3672018-12-03 368 - 1.17.7 369 - [BUGFIX] Do not unset PING alarm before ringing expired alarms. 370 This prevented PING from ever being sent. 371 3722018-11-29 373 - 1.17.6 374 - Add failsafe: resume sending packets after some time 375 376 The change puts a 1-second limit on the amount of time the engine 377 will not send packets after some packets are delayed. This makes 378 the library robust in case the user does not unblock the engine 379 explicitly using lsquic_engine_send_unsent_packets() call. 380 381 - [BUGFIX] Handle corner cases in send controller when packets are 382 a) delayed or b) dropped during repackaging. 383 - [BUGFIX] Memory leak: destroy buffered packets during controller 384 cleanup. 385 3862018-11-16 387 - 1.17.3 388 - [BUGFIX] Do not send STOP_WAITING frames when using Q044 389 3902018-10-19 391 - 1.17.2 392 - [BUGFIX] Memory leak in test_frame_rw unit test. 393 - [BUGFIX] Parsing packets with short IETF header: do not overwrite 394 flags. (Only a problem in unit tests -- benign otherwise.) 395 3962018-10-16 397 - 1.17.0 398 - [API Change] Packet out Memory Interface (PMI) update: 399 - Split PMI pool return into pmi_release and pmi_return 400 - PMI callbacks take peer_ctx and is_ipv6 arguments 401 - [BUGFIX] Fix use-after-free when certificate is updated 402 - Silence gcc warning in optimized mode by performing useless 403 initialization 404 - cmake: use the standard variable CMAKE_BUILD_TYPE instead of 405 DEVEL_MODE 406 4072018-10-03 408 - 1.16.0 409 - [API Change] Add lsquic_conn_n_avail_streams() 410 - [BUGFIX] only dispatch crypto stream read events if WANT_READ is on 411 4122018-09-27 413 - 1.15.0 414 - [API Change] Add LSCONN_ST_PEER_GOING_AWAY to the list of conn statuses 415 - [BUGFIX] free uncompressed headers correctly when error occurs 416 4172018-09-12 418 - 1.14.3 419 - [BUGFIX] Do not abort conn on STREAM frame for a reset stream 420 - [BUGFIX] Drop packets that would become empty due to repackaging. 421 Packets on the scheduled queue may be marked for repackaging. 422 Frames such as ACK frame that are never resent are removed from 423 repackaged packets. We must check that the newly repackaged packet 424 would not be empty. If it would be, it is destroyed instead and 425 the next packet on the scheduled queue is used. Note that this 426 change only affects the logic to return the next packet to be sent. 427 Lost packets that are being rescheduled are already processed in 428 this fashion. 429 - Byteswap CID before logging it - this makes it match Chrome CIDs. 430 (Except Q035, which is the last little-endian GQUIC version we 431 support.) 432 4332018-09-06 434 - 1.14.0 435 - [API Change] Disable packet sending if full batch cannot be sent 436 If lsquic_packets_out_f() cannot send the whole batch, disable 437 packet sending until lsquic_engine_send_unsent_packets() is called. 438 - [BUGFIX] Handle case when STREAM frame does not fit. 439 - [BUGFIX] Always allow incoming STREAM frames to overlap. Peers 440 may send overlapping STREAM frames even if using versions older 441 than Q043. 442 - Custom header set fixes: 443 - set "FIN reached" flag when custom header with FIN flag is 444 claimed; 445 - do not return custom header set for a reset stream. 446 4472018-08-27 448 449 - 1.13.0 450 - [FEATURE, API Change] Add ability to create custom header set 451 objects via callbacks. This avoids reading and re-parsing 452 headers from the stream. 453 4542018-08-27 455 456 - 1.12.4 457 - Fix memory leak when engine is destroyed 458 - Fix memory leak in http_client 459 - Fix gcc warning in unit tests 460 4612018-08-22 462 463 - 1.12.3 464 - [BUGFIX] Fix duplicate STREAM frame detection 465 4662018-08-20 467 468 - 1.12.2 469 - [BUGFIX] Update count of scheduled bytes when adjusting size of 470 an already-scheduled packet. 471 - Emit info instead of warning messages when stream is used in 472 unexpected ways. 473 4742018-08-17 475 476 - 1.12.0 477 - [FEATURE, API Change] Add support for certificate verification 478 4792018-08-16 480 481 - 1.11.1 482 - [BUGFIX] Fix STOP_WAITING frame processing in the new Q044 code 483 4842018-08-15 485 486 - 1.11.0 487 - [FEATURE] Add support for Q044. 488 4892018-08-09 490 491 - 1.10.2 492 - [BUGFIX] Don't go over limit when creating delayed streams 493 4942018-07-10 495 496 - 1.10.1 497 - [BUGFIX] process connections after each batch of packets is read 498 This avoids a problem of accumulating a very large list of packets 499 (possible when speeds are high and socket's receive buffer is large) 500 and processing it all at once. 501 - If glibc is older than 2.17, link with rt. This is necessary for 502 clock_getres(2). 503 - Add version macros to lsquic.h; remove unnecessary includes. 504 5052018-06-13 506 507 - [BUGFIX] allow multiple parallel connections by default 508 509 Use the original method of tracking connections by CIDs by default. 510 If zero-sized CID support is turned on, connections are tracked by 511 the address. A new connection is not created if another connection 512 is using the same network address 513 5142018-05-30 515 516 - [FEATURE, API CHANGE] Support zero-sized CIDs in received packets 517 5182018-05-24 519 520 - Close connection properly when packet encryption fails 521 5222018-05-23 523 524 - [BUGFIX] Do not produce packet sequence gaps due to delayed packets 525 5262018-05-21 527 528 - [API Change] Add optional callback to call when handshake is done 529 - [API Change, BUGFIX] After send failure, wait until transport available 530 5312018-05-18 532 533 - [API] Expose useful lsquic_ver2str[] in lsquic.h 534 - [BUGFIX] Do not produce packet sequence gaps due to STREAM frame elision 535 - Improve checks of number of incoming streams limit and associated 536 error reporting. 537 - [BUGFIX] Command-line option `-6` now works correctly. 538 5392018-05-16 540 541 - [FEATURE] DNS resolution 542 - [BUGFIX] Frame insertion mis-ID as overlap instead of dup 543 - http_client: fix priority range generated by -E flag 544 5452018-05-09 546 547 - [FEATURE] Add support for Q043. 548 - Support for versions Q037, Q038, Q041, and Q042 has been removed. 549 - Fix typo in debug message. 550 - Fix code indentation. 551 - Add /* fallthru */ comment to stop newer gcc from complaining. 552 - Logger: fix compilation of optimized Windows build. 553 5542018-05-04 555 556 - [FEATURE] Add support for Q042. 557 - Remove comment: MSPC is obsolete (no code changes) 558 - Prog: use lsquic_str2ver() when processing -o version flag 559 - Remove unused CTIM and SRBF transport parameters 560 - Disable QUIC versions Q037 and Q038 by default 561 - Fix Windows compilation by including compat header file in 562 lshpack.c 563 - Address warnings produced by newer versions of gcc 564 - Future-proof: turn off -Werror 565 5662018-05-02 567 568 - [BUGFIX] Make lsquic_conn_quic_version() available 569 - Switch to using ls-hpack 1.1 570 - [BUGFIX] Do not ignore stream resets after receiving FIN 571 5722018-04-27 573 574 - HPACK: do not allow header block to end with table size update. 575 5762018-04-25 577 578 - [BUGFIX] Do not create gap in sent packnos when squeezing delayed 579 packets. 580 - [BUGFIX] sendctl checks for all unacked bytes, not just retx bytes. 581 - [BUGFIX] connections with blocked scheduled packets are not tickable 582 for sending. 583 - [BUGFIX] Conn is tickable if it wants to send a connection-level 584 frame. 585 5862018-04-23 587 588 - Fix busy loop: tickable must make progress. When connection is 589 self-reporting as tickable, it must make progress when ticked. There 590 are two issues: 591 1. If there are buffered packets, the connection is only tickable if 592 they can be sent out. 593 2. A connection is tickable if there are streams on the servicing 594 queue. When the tick occurs, we must service the stream 595 independent of whether any packets are sent. 596 - Fix assertion in pacer which can be incorrect under some 597 conditions. 598 - cmake: do not turn on address sanitizer if in Travis. 599 6002018-04-20 601 602 - [BUGFIX] Fix bug in lsquic_engine_connect() exposed by yesterday's 603 changes. 604 6052018-04-19 606 607 - [BUGFIX] Add connection to Tickable Queue on stream write 608 - cmake: use MSVC variable instead of trying to detect 609 - engine: improve connection incref/decref logging 610 - stream: don't ignore errors that may occur on triggered flush 611 - connection: remove obsolete method 612 - engine: indicate connection as tickable if previous call went 613 over threshold 614 6152018-04-09 616 617 [API Change, OPTIMIZATION] Only process conns that need to be processed 618 619 The API is simplified: do not expose the user code to several 620 queues. A "connection queue" is now an internal concept. 621 The user processes connections using the single function 622 lsquic_engine_process_conns(). When this function is called, 623 only those connections are processed that need to be processed. 624 A connection needs to be processed when: 625 626 1. New incoming packets have been fed to the connection. 627 2. User wants to read from a stream that is readable. 628 3. User wants to write to a stream that is writeable. 629 4. There are buffered packets that can be sent out. (This 630 means that the user wrote to a stream outside of the 631 lsquic library callback.) 632 5. A control frame (such as BLOCKED) needs to be sent out. 633 6. A stream needs to be serviced or delayed stream needs to 634 be created. 635 7. An alarm rings. 636 8. Pacer timer expires. 637 638 To achieve this, the library places the connections into two 639 priority queues (min heaps): 640 641 1. Tickable Queue; and 642 2. Advisory Tick Time queue (ATTQ). 643 644 Each time lsquic_engine_process_conns() is called, the Tickable 645 Queue is emptied. After the connections have been ticked, they are 646 queried again: if a connection is not being closed, it is placed 647 either in the Tickable Queue if it is ready to be ticked again or 648 it is placed in the Advisory Tick Time Queue. It is assumed that 649 a connection always has at least one timer set (the idle alarm). 650 651 The connections in the Tickable Queue are arranged in the least 652 recently ticked order. This lets connections that have been quiet 653 longer to get their packets scheduled first. 654 655 This change means that the library no longer needs to be ticked 656 periodically. The user code can query the library when is the 657 next tick event and schedule it exactly. When connections are 658 processed, only the tickable connections are processed, not *all* 659 the connections. When there are no tick events, it means that no 660 timer event is necessary -- only the file descriptor READ event 661 is active. 662 663 The following are improvements and simplifications that have 664 been triggered: 665 666 - Queue of connections with incoming packets is gone. 667 - "Pending Read/Write Events" Queue is gone (along with its 668 history and progress checks). This queue has become the 669 Tickable Queue. 670 - The connection hash no longer needs to track the connection 671 insertion order. 672 6732018-04-02 674 675 - [FEATURE] Windows support 676 677 - Reduce stack use -- outgoing packet batch is now allocated on the heap. 678 6792018-03-09 680 681 - [OPTIMIZATION] Merge series of ACKs if possible 682 683 Parsed single-range ACK frames (that is the majority of frames) are 684 saved in the connection and their processing is deferred until the 685 connection is ticked. If several ACKs come in a series between 686 adjacent ticks, we check whether the latest ACK is a strict superset 687 of the saved ACK. If it is, the older ACK is not processed. 688 689 If ACK frames can be merged, they are merged and only one of them is 690 either processed or saved. 691 692 - [OPTIMIZATION] Speed up ACK verification by simplifying send history. 693 694 Never generate a gap in the sent packet number sequence. This reduces 695 the send history to a single number instead of potentially a series of 696 packet ranges and thereby speeds up ACK verification. 697 698 By default, detecting a gap in the send history is not fatal: only a 699 single warning is generated per connection. The connection can continue 700 to operate even if the ACK verification code is not able to detect some 701 inconsistencies. 702 703 - [OPTIMIZATION] Rearrange the lsquic_send_ctl struct 704 705 The first part of struct lsquic_send_ctl now consists of members that 706 are used in lsquic_send_ctl_got_ack() (in the absense of packet loss, 707 which is the normal case). To speed up reads and writes, we no longer 708 try to save space by using 8- and 16-bit integers. Use regular integer 709 width for everything. 710 711 - [OPTIMIZATION] Cache size of sent packet. 712 713 - [OPTIMIZATION] Keep track of the largest ACKed in packet_out 714 715 Instead of parsing our own ACK frames when packet has been acked, 716 use the value saved in the packet_out structure when the ACK frame 717 was generated. 718 719 - [OPTIMIZATION] Take RTT sampling conditional out of ACK loop 720 721 - [OPTIMIZATION] ACK processing: only call clock_gettime() if needed 722 723 - [OPTIMIZATION] Several code-level optimizations to ACK processing. 724 725 - Fix: http_client: fix -I flag; switch assert() to abort() 726 7272018-02-26 728 - [API Change] lsquic_engine_connect() returns pointer to the connection 729 object. 730 - [API Change] Add lsquic_conn_get_engine() to get engine object from 731 connection object. 732 - [API Change] Add lsquic_conn_status() to query connection status. 733 - [API Change] Add add lsquic_conn_set_ctx(). 734 - [API Change] Add new timestamp format, e.g. 2017-03-21 13:43:46.671345 735 - [OPTIMIZATION] Process handshake STREAM frames as soon as packet 736 arrives. 737 - [OPTIMIZATION] Do not compile expensive send controller sanity check 738 by default. 739 - [OPTIMIZATION] Add fast path to gquic_be_gen_reg_pkt_header. 740 - [OPTIMIZATION] Only make squeeze function call if necessary. 741 - [OPTIMIZATION] Speed up Q039 ACK frame parsing. 742 - [OPTIMIZATION] Fit most used elements of packet_out into first 64 bytes. 743 - [OPTIMIZATION] Keep track of scheduled bytes instead of calculating. 744 - [OPTIMIZATION] Prefetch next unacked packet when processing ACK. 745 - [OPTIMIZATION] Leverage fact that ACK ranges and unacked list are. 746 ordered. 747 - [OPTIMIZATION] Reduce function pointer use for STREAM frame generation 748 - Fix: reset incoming streams that arrive after we send GOAWAY. 749 - Fix: delay client on_new_conn() call until connection is fully set up. 750 - Fixes to buffered packets logic: splitting, STREAM frame elision. 751 - Fix: do not dispatch on_write callback if no packets are available. 752 - Fix WINDOW_UPDATE send and resend logic. 753 - Fix STREAM frame extension code. 754 - Fix: Drop unflushed data when stream is reset. 755 - Switch to tracking CWND using bytes rather than packets. 756 - Fix TCP friendly adjustment in cubic. 757 - Fix: do not generate invalid STOP_WAITING frames during high packet 758 loss. 759 - Pacer fixes. 760 7612017-12-18 762 763 - Fix: better follow cubic curve after idle period 764 - Fix: add missing parts to outgoing packet splitting code 765 - Fix: compilation using gcc 4.8.4 766 7672017-10-31 768 769 - Add APIs.txt -- describes LSQUIC APIs 770 7712017-10-31 772 773 - [API Change] Sendfile-like functionality is gone. The stream no 774 longer opens files and deals with file descriptors. (Among other 775 things, this makes the code more portable.) Three writing functions 776 are provided: 777 778 lsquic_stream_write 779 lsquic_stream_writev 780 lsquic_stream_writef (NEW) 781 782 lsquic_stream_writef() is given an abstract reader that has function 783 pointers for size() and read() functions which the user can implement. 784 This is the most flexible way. lsquic_stream_write() and 785 lsquic_stream_writev() are now both implemented as wrappers around 786 lsquic_stream_writef(). 787 788 - [OPTIMIZATION] When writing to stream, be it within or without the 789 on_write() callback, place data directly into packet buffer, 790 bypassing auxiliary data structures. This reduces amount of memory 791 required, for the amount of data that can be written is limited 792 by the congestion window. 793 794 To support writes outside the on_write() callback, we keep N 795 outgoing packet buffers per connection which can be written to 796 by any stream. One half of these are reserved for the highest 797 priority stream(s), the other half for all other streams. This way, 798 low-priority streams cannot write instead of high-priority streams 799 and, on the other hand, low-priority streams get a chance to send 800 their packets out. 801 802 The algorithm is as follows: 803 804 - When user writes to stream outside of the callback: 805 - If this is the highest priority stream, place it onto the 806 reserved N/2 queue or fail. 807 (The actual size of this queue is dynamic -- MAX(N/2, CWND) -- 808 rather than N/2, allowing high-priority streams to write as 809 much as can be sent.) 810 - If the stream is not the highest priority, try to place the 811 data onto the reserved N/2 queue or fail. 812 - When tick occurs *and* more packets can be scheduled: 813 - Transfer packets from the high N/2 queue to the scheduled 814 queue. 815 - If more scheduling is allowed: 816 - Call on_write callbacks for highest-priority streams, 817 placing resulting packets directly onto the scheduled queue. 818 - If more scheduling is allowed: 819 - Transfer packets from the low N/2 queue to the scheduled 820 queue. 821 - If more scheduling is allowed: 822 - Call on_write callbacks for non-highest-priority streams, 823 placing resulting packets directly onto the scheduled queue 824 825 The number N is currently 20, but it could be varied based on 826 resource usage. 827 828 - If stream is created due to incoming headers, make headers readable 829 from on_new. 830 831 - Outgoing packets are no longer marked non-writeable to prevent placing 832 more than one STREAM frame from the same stream into a single packet. 833 This property is maintained via code flow and an explicit check. 834 Packets for stream data are allocated using a special function. 835 836 - STREAM frame elision is cheaper, as we only perform it if a reset 837 stream has outgoing packets referencing it. 838 839 - lsquic_packet_out_t is smaller, as stream_rec elements are now 840 inside a union. 841 8422017-10-12 843 844 - Do not send RST_STREAM when stream is closed for reading 845 - Raise maximum header size from 4K to 64K 846 - Check header name and value lengths against maximum imposed by HPACK 847 - Fix NULL dereference in stream flow controller 848 8492017-10-09 850 851 - Hide handshake implementation behind a set of function pointers 852 - Use monotonically increasing clock 853 - Make sure that retx delay is not larger than the max of 60 seconds 854 8552017-09-29 856 857 - A few fixes to code and README 858 8592017-09-28 860 861 - Add support for Q041; drop support for Q040 862 8632017-09-27 864 865 - Fix CMakeLists.txt: BoringSSL include and lib was mixed up 866 8672017-09-26 868 869 - Add support for Mac OS 870 - Add support for Raspberry Pi 871 - Fix BoringSSL compilation: include <openssl/hmac.h> explicitly 872 8732017-09-22 874 875 - Initial release 876