CHANGELOG revision 9c444524
12019-02-18 2 - 1.19.3 3 - [BUGFIX] Q044: don't encode packet number in 6 bytes. Six-byte 4 packet number encoding does not exist in Q044. This fixes a 5 regression introduced in '[BUGFIX] Buffered packets can contain 6 ACK frames' -- we need to keep QUIC version in mind when selecting 7 the longest possible packet number encoding used for the buffered 8 packet that carries the ACK. 9 - [BUGFIX] Do not increase CWND when timeout occurs. 10 - http_client: support setting handshake timeout on command line. 11 Use -o handshake_to=timeout. 12 - http_client: use -k to connect UDP socket to pick up ICMP errors. 13 - http_client: allow pathless mode, when only handshake is performed 14 without issuing any requests. This can be done by simply not 15 specifying a -p flag on the command line. 16 172019-02-11 18 - 1.19.2 19 - [BUGFIX] Begin negotiation with version provided in 0-RTT info. 20 - [BUGFIX] Version checking in zero_rtt deserialize function. 21 222019-02-04 23 - 1.19.1 24 - [BUGFIX] Fix Windows build. 25 262019-02-04 27 - 1.19.0 28 - [FEATURE, API Change] 0-RTT support. Add function to export 0-RTT 29 information; it can be supplied to a subsequent connect() call. 30 - [FEATURE] Add -0 flag to http_client to exercise 0-RTT support. 31 - [BUGFIX] Resuscitate the Windows build. 32 - [BUGFIX] Send HTTP settings (max header list size) if necessary. 33 - [BUGFIX] Buffered packets can contain ACK frames. 34 - [BUGFIX] Make packet writeable once all STREAM frames are elided. 35 - [BUGFIX] Fix potential null dereference when realloc fails. 36 - cmake: simplify build configuration. 37 382019-01-28 39 - 1.18.0 40 - [API Change] Can specify clock granularity in engine settings. 41 - [BUGFIX] Pacer uses fixed clock granularity. Since the change on 42 2018-04-09, it is not necessary to try to approximate the next tick 43 time in the pacer: it can use fix clock granularity specified by 44 the user. 45 - [BUGFIX] Do not tick constantly before handshake is done. 46 - [BUGFIX] Do not exit tick prematurely: reuse packet with ACK. Even 47 if we cannot allocate *more* packets, we could still be able to write 48 to one already allocated. 49 - [BUGFIX] Do not schedule pacer if there are no lost packets. 50 512019-01-17 52 - 1.17.15 53 - [BUGFIX] http_client: make sure only one read per on_read() callback 54 is performed in the header conversion bypass (-B) mode. 55 - http_client: with -E, assign random priority when stream is created. 56 - [OPTIMIZATION] On immediate write, place an ACK frame into the first 57 buffered packet if an ACK is queued. This reduces the number of 58 standalone ACK packets. 59 - [OPTIMIZATION] Allow placing more than one STREAM frame from the same 60 stream into an outgoing packet. This change minimizes the number of 61 buffered packets required to store several small HTTP messages by 62 virtue of allowing more than one STREAM frame from HEADERS stream in 63 the same packet. 64 - [OPTIMIZATION] Flush headers when writing to buffered packets. This 65 causes the headers to be written to the same buffered packet queue, 66 thereby improving packet utilization, especially for small HTTP 67 messages. 68 692019-01-16 70 - 1.17.14 71 - [FEATURE] http_client can now collect stats: time to connect, TTFB, 72 time to download, requests per seconds, and bandwidth. See -t flag. 73 - [BUGFIX] http_client: -B, -K, and -r can be used at the same time. 74 - [BUGFIX] http_client: do not display cert chain before each request. 75 Now this is only done once per connection, if the handshake is 76 successful and -a option is given. 77 - [BUGFIX] Do not wait to dispatch on_close() after reading. If a 78 stream is scheduled to be closed after on_read() callback returns, 79 close it immediately instead of waiting until the end of the tick. 80 If client creates new request from on_close() event, they will be 81 processed in the same tick instead of waiting for the next one. 82 - [BUGFIX] HEADERS stream is critical: always treat it with highest 83 priority. 84 852019-01-10 86 - 1.17.12 87 - [FEATURE] http_client can now issue parallel requests in the context 88 of a single connection. See -w option. 89 902019-01-03 91 - 1.17.11 92 - Fix strict aliasing warning in optimized compilation. 93 942018-12-27 95 - 1.17.10 96 - Fix the example program to be able to use parallel connections 97 again. (See the -n argument.) 98 992018-12-18 100 - 1.17.9 101 - [BUGFIX] Engine: reduce minimum batch size from 256 to 4 102 1032018-12-10 104 - 1.17.8 105 - [BUGFIX] Fix compilation on FreeBSD and 32-bit Linux 106 1072018-12-03 108 - 1.17.7 109 - [BUGFIX] Do not unset PING alarm before ringing expired alarms. 110 This prevented PING from ever being sent. 111 1122018-11-29 113 - 1.17.6 114 - Add failsafe: resume sending packets after some time 115 116 The change puts a 1-second limit on the amount of time the engine 117 will not send packets after some packets are delayed. This makes 118 the library robust in case the user does not unblock the engine 119 explicitly using lsquic_engine_send_unsent_packets() call. 120 121 - [BUGFIX] Handle corner cases in send controller when packets are 122 a) delayed or b) dropped during repackaging. 123 - [BUGFIX] Memory leak: destroy buffered packets during controller 124 cleanup. 125 1262018-11-16 127 - 1.17.3 128 - [BUGFIX] Do not send STOP_WAITING frames when using Q044 129 1302018-10-19 131 - 1.17.2 132 - [BUGFIX] Memory leak in test_frame_rw unit test. 133 - [BUGFIX] Parsing packets with short IETF header: do not overwrite 134 flags. (Only a problem in unit tests -- benign otherwise.) 135 1362018-10-16 137 - 1.17.0 138 - [API Change] Packet out Memory Interface (PMI) update: 139 - Split PMI pool return into pmi_release and pmi_return 140 - PMI callbacks take peer_ctx and is_ipv6 arguments 141 - [BUGFIX] Fix use-after-free when certificate is updated 142 - Silence gcc warning in optimized mode by performing useless 143 initialization 144 - cmake: use the standard variable CMAKE_BUILD_TYPE instead of 145 DEVEL_MODE 146 1472018-10-03 148 - 1.16.0 149 - [API Change] Add lsquic_conn_n_avail_streams() 150 - [BUGFIX] only dispatch crypto stream read events if WANT_READ is on 151 1522018-09-27 153 - 1.15.0 154 - [API Change] Add LSCONN_ST_PEER_GOING_AWAY to the list of conn statuses 155 - [BUGFIX] free uncompressed headers correctly when error occurs 156 1572018-09-12 158 - 1.14.3 159 - [BUGFIX] Do not abort conn on STREAM frame for a reset stream 160 - [BUGFIX] Drop packets that would become empty due to repackaging. 161 Packets on the scheduled queue may be marked for repackaging. 162 Frames such as ACK frame that are never resent are removed from 163 repackaged packets. We must check that the newly repackaged packet 164 would not be empty. If it would be, it is destroyed instead and 165 the next packet on the scheduled queue is used. Note that this 166 change only affects the logic to return the next packet to be sent. 167 Lost packets that are being rescheduled are already processed in 168 this fashion. 169 - Byteswap CID before logging it - this makes it match Chrome CIDs. 170 (Except Q035, which is the last little-endian GQUIC version we 171 support.) 172 1732018-09-06 174 - 1.14.0 175 - [API Change] Disable packet sending if full batch cannot be sent 176 If lsquic_packets_out_f() cannot send the whole batch, disable 177 packet sending until lsquic_engine_send_unsent_packets() is called. 178 - [BUGFIX] Handle case when STREAM frame does not fit. 179 - [BUGFIX] Always allow incoming STREAM frames to overlap. Peers 180 may send overlapping STREAM frames even if using versions older 181 than Q043. 182 - Custom header set fixes: 183 - set "FIN reached" flag when custom header with FIN flag is 184 claimed; 185 - do not return custom header set for a reset stream. 186 1872018-08-27 188 189 - 1.13.0 190 - [FEATURE, API Change] Add ability to create custom header set 191 objects via callbacks. This avoids reading and re-parsing 192 headers from the stream. 193 1942018-08-27 195 196 - 1.12.4 197 - Fix memory leak when engine is destroyed 198 - Fix memory leak in http_client 199 - Fix gcc warning in unit tests 200 2012018-08-22 202 203 - 1.12.3 204 - [BUGFIX] Fix duplicate STREAM frame detection 205 2062018-08-20 207 208 - 1.12.2 209 - [BUGFIX] Update count of scheduled bytes when adjusting size of 210 an already-scheduled packet. 211 - Emit info instead of warning messages when stream is used in 212 unexpected ways. 213 2142018-08-17 215 216 - 1.12.0 217 - [FEATURE, API Change] Add support for certificate verification 218 2192018-08-16 220 221 - 1.11.1 222 - [BUGFIX] Fix STOP_WAITING frame processing in the new Q044 code 223 2242018-08-15 225 226 - 1.11.0 227 - [FEATURE] Add support for Q044. 228 2292018-08-09 230 231 - 1.10.2 232 - [BUGFIX] Don't go over limit when creating delayed streams 233 2342018-07-10 235 236 - 1.10.1 237 - [BUGFIX] process connections after each batch of packets is read 238 This avoids a problem of accumulating a very large list of packets 239 (possible when speeds are high and socket's receive buffer is large) 240 and processing it all at once. 241 - If glibc is older than 2.17, link with rt. This is necessary for 242 clock_getres(2). 243 - Add version macros to lsquic.h; remove unnecessary includes. 244 2452018-06-13 246 247 - [BUGFIX] allow multiple parallel connections by default 248 249 Use the original method of tracking connections by CIDs by default. 250 If zero-sized CID support is turned on, connections are tracked by 251 the address. A new connection is not created if another connection 252 is using the same network address 253 2542018-05-30 255 256 - [FEATURE, API CHANGE] Support zero-sized CIDs in received packets 257 2582018-05-24 259 260 - Close connection properly when packet encryption fails 261 2622018-05-23 263 264 - [BUGFIX] Do not produce packet sequence gaps due to delayed packets 265 2662018-05-21 267 268 - [API Change] Add optional callback to call when handshake is done 269 - [API Change, BUGFIX] After send failure, wait until transport available 270 2712018-05-18 272 273 - [API] Expose useful lsquic_ver2str[] in lsquic.h 274 - [BUGFIX] Do not produce packet sequence gaps due to STREAM frame elision 275 - Improve checks of number of incoming streams limit and associated 276 error reporting. 277 - [BUGFIX] Command-line option `-6` now works correctly. 278 2792018-05-16 280 281 - [FEATURE] DNS resolution 282 - [BUGFIX] Frame insertion mis-ID as overlap instead of dup 283 - http_client: fix priority range generated by -E flag 284 2852018-05-09 286 287 - [FEATURE] Add support for Q043. 288 - Support for versions Q037, Q038, Q041, and Q042 has been removed. 289 - Fix typo in debug message. 290 - Fix code indentation. 291 - Add /* fallthru */ comment to stop newer gcc from complaining. 292 - Logger: fix compilation of optimized Windows build. 293 2942018-05-04 295 296 - [FEATURE] Add support for Q042. 297 - Remove comment: MSPC is obsolete (no code changes) 298 - Prog: use lsquic_str2ver() when processing -o version flag 299 - Remove unused CTIM and SRBF transport parameters 300 - Disable QUIC versions Q037 and Q038 by default 301 - Fix Windows compilation by including compat header file in 302 lshpack.c 303 - Address warnings produced by newer versions of gcc 304 - Future-proof: turn off -Werror 305 3062018-05-02 307 308 - [BUGFIX] Make lsquic_conn_quic_version() available 309 - Switch to using ls-hpack 1.1 310 - [BUGFIX] Do not ignore stream resets after receiving FIN 311 3122018-04-27 313 314 - HPACK: do not allow header block to end with table size update. 315 3162018-04-25 317 318 - [BUGFIX] Do not create gap in sent packnos when squeezing delayed 319 packets. 320 - [BUGFIX] sendctl checks for all unacked bytes, not just retx bytes. 321 - [BUGFIX] connections with blocked scheduled packets are not tickable 322 for sending. 323 - [BUGFIX] Conn is tickable if it wants to send a connection-level 324 frame. 325 3262018-04-23 327 328 - Fix busy loop: tickable must make progress. When connection is 329 self-reporting as tickable, it must make progress when ticked. There 330 are two issues: 331 1. If there are buffered packets, the connection is only tickable if 332 they can be sent out. 333 2. A connection is tickable if there are streams on the servicing 334 queue. When the tick occurs, we must service the stream 335 independent of whether any packets are sent. 336 - Fix assertion in pacer which can be incorrect under some 337 conditions. 338 - cmake: do not turn on address sanitizer if in Travis. 339 3402018-04-20 341 342 - [BUGFIX] Fix bug in lsquic_engine_connect() exposed by yesterday's 343 changes. 344 3452018-04-19 346 347 - [BUGFIX] Add connection to Tickable Queue on stream write 348 - cmake: use MSVC variable instead of trying to detect 349 - engine: improve connection incref/decref logging 350 - stream: don't ignore errors that may occur on triggered flush 351 - connection: remove obsolete method 352 - engine: indicate connection as tickable if previous call went 353 over threshold 354 3552018-04-09 356 357 [API Change, OPTIMIZATION] Only process conns that need to be processed 358 359 The API is simplified: do not expose the user code to several 360 queues. A "connection queue" is now an internal concept. 361 The user processes connections using the single function 362 lsquic_engine_process_conns(). When this function is called, 363 only those connections are processed that need to be processed. 364 A connection needs to be processed when: 365 366 1. New incoming packets have been fed to the connection. 367 2. User wants to read from a stream that is readable. 368 3. User wants to write to a stream that is writeable. 369 4. There are buffered packets that can be sent out. (This 370 means that the user wrote to a stream outside of the 371 lsquic library callback.) 372 5. A control frame (such as BLOCKED) needs to be sent out. 373 6. A stream needs to be serviced or delayed stream needs to 374 be created. 375 7. An alarm rings. 376 8. Pacer timer expires. 377 378 To achieve this, the library places the connections into two 379 priority queues (min heaps): 380 381 1. Tickable Queue; and 382 2. Advisory Tick Time queue (ATTQ). 383 384 Each time lsquic_engine_process_conns() is called, the Tickable 385 Queue is emptied. After the connections have been ticked, they are 386 queried again: if a connection is not being closed, it is placed 387 either in the Tickable Queue if it is ready to be ticked again or 388 it is placed in the Advisory Tick Time Queue. It is assumed that 389 a connection always has at least one timer set (the idle alarm). 390 391 The connections in the Tickable Queue are arranged in the least 392 recently ticked order. This lets connections that have been quiet 393 longer to get their packets scheduled first. 394 395 This change means that the library no longer needs to be ticked 396 periodically. The user code can query the library when is the 397 next tick event and schedule it exactly. When connections are 398 processed, only the tickable connections are processed, not *all* 399 the connections. When there are no tick events, it means that no 400 timer event is necessary -- only the file descriptor READ event 401 is active. 402 403 The following are improvements and simplifications that have 404 been triggered: 405 406 - Queue of connections with incoming packets is gone. 407 - "Pending Read/Write Events" Queue is gone (along with its 408 history and progress checks). This queue has become the 409 Tickable Queue. 410 - The connection hash no longer needs to track the connection 411 insertion order. 412 4132018-04-02 414 415 - [FEATURE] Windows support 416 417 - Reduce stack use -- outgoing packet batch is now allocated on the heap. 418 4192018-03-09 420 421 - [OPTIMIZATION] Merge series of ACKs if possible 422 423 Parsed single-range ACK frames (that is the majority of frames) are 424 saved in the connection and their processing is deferred until the 425 connection is ticked. If several ACKs come in a series between 426 adjacent ticks, we check whether the latest ACK is a strict superset 427 of the saved ACK. If it is, the older ACK is not processed. 428 429 If ACK frames can be merged, they are merged and only one of them is 430 either processed or saved. 431 432 - [OPTIMIZATION] Speed up ACK verification by simplifying send history. 433 434 Never generate a gap in the sent packet number sequence. This reduces 435 the send history to a single number instead of potentially a series of 436 packet ranges and thereby speeds up ACK verification. 437 438 By default, detecting a gap in the send history is not fatal: only a 439 single warning is generated per connection. The connection can continue 440 to operate even if the ACK verification code is not able to detect some 441 inconsistencies. 442 443 - [OPTIMIZATION] Rearrange the lsquic_send_ctl struct 444 445 The first part of struct lsquic_send_ctl now consists of members that 446 are used in lsquic_send_ctl_got_ack() (in the absense of packet loss, 447 which is the normal case). To speed up reads and writes, we no longer 448 try to save space by using 8- and 16-bit integers. Use regular integer 449 width for everything. 450 451 - [OPTIMIZATION] Cache size of sent packet. 452 453 - [OPTIMIZATION] Keep track of the largest ACKed in packet_out 454 455 Instead of parsing our own ACK frames when packet has been acked, 456 use the value saved in the packet_out structure when the ACK frame 457 was generated. 458 459 - [OPTIMIZATION] Take RTT sampling conditional out of ACK loop 460 461 - [OPTIMIZATION] ACK processing: only call clock_gettime() if needed 462 463 - [OPTIMIZATION] Several code-level optimizations to ACK processing. 464 465 - Fix: http_client: fix -I flag; switch assert() to abort() 466 4672018-02-26 468 - [API Change] lsquic_engine_connect() returns pointer to the connection 469 object. 470 - [API Change] Add lsquic_conn_get_engine() to get engine object from 471 connection object. 472 - [API Change] Add lsquic_conn_status() to query connection status. 473 - [API Change] Add add lsquic_conn_set_ctx(). 474 - [API Change] Add new timestamp format, e.g. 2017-03-21 13:43:46.671345 475 - [OPTIMIZATION] Process handshake STREAM frames as soon as packet 476 arrives. 477 - [OPTIMIZATION] Do not compile expensive send controller sanity check 478 by default. 479 - [OPTIMIZATION] Add fast path to gquic_be_gen_reg_pkt_header. 480 - [OPTIMIZATION] Only make squeeze function call if necessary. 481 - [OPTIMIZATION] Speed up Q039 ACK frame parsing. 482 - [OPTIMIZATION] Fit most used elements of packet_out into first 64 bytes. 483 - [OPTIMIZATION] Keep track of scheduled bytes instead of calculating. 484 - [OPTIMIZATION] Prefetch next unacked packet when processing ACK. 485 - [OPTIMIZATION] Leverage fact that ACK ranges and unacked list are. 486 ordered. 487 - [OPTIMIZATION] Reduce function pointer use for STREAM frame generation 488 - Fix: reset incoming streams that arrive after we send GOAWAY. 489 - Fix: delay client on_new_conn() call until connection is fully set up. 490 - Fixes to buffered packets logic: splitting, STREAM frame elision. 491 - Fix: do not dispatch on_write callback if no packets are available. 492 - Fix WINDOW_UPDATE send and resend logic. 493 - Fix STREAM frame extension code. 494 - Fix: Drop unflushed data when stream is reset. 495 - Switch to tracking CWND using bytes rather than packets. 496 - Fix TCP friendly adjustment in cubic. 497 - Fix: do not generate invalid STOP_WAITING frames during high packet 498 loss. 499 - Pacer fixes. 500 5012017-12-18 502 503 - Fix: better follow cubic curve after idle period 504 - Fix: add missing parts to outgoing packet splitting code 505 - Fix: compilation using gcc 4.8.4 506 5072017-10-31 508 509 - Add APIs.txt -- describes LSQUIC APIs 510 5112017-10-31 512 513 - [API Change] Sendfile-like functionality is gone. The stream no 514 longer opens files and deals with file descriptors. (Among other 515 things, this makes the code more portable.) Three writing functions 516 are provided: 517 518 lsquic_stream_write 519 lsquic_stream_writev 520 lsquic_stream_writef (NEW) 521 522 lsquic_stream_writef() is given an abstract reader that has function 523 pointers for size() and read() functions which the user can implement. 524 This is the most flexible way. lsquic_stream_write() and 525 lsquic_stream_writev() are now both implemented as wrappers around 526 lsquic_stream_writef(). 527 528 - [OPTIMIZATION] When writing to stream, be it within or without the 529 on_write() callback, place data directly into packet buffer, 530 bypassing auxiliary data structures. This reduces amount of memory 531 required, for the amount of data that can be written is limited 532 by the congestion window. 533 534 To support writes outside the on_write() callback, we keep N 535 outgoing packet buffers per connection which can be written to 536 by any stream. One half of these are reserved for the highest 537 priority stream(s), the other half for all other streams. This way, 538 low-priority streams cannot write instead of high-priority streams 539 and, on the other hand, low-priority streams get a chance to send 540 their packets out. 541 542 The algorithm is as follows: 543 544 - When user writes to stream outside of the callback: 545 - If this is the highest priority stream, place it onto the 546 reserved N/2 queue or fail. 547 (The actual size of this queue is dynamic -- MAX(N/2, CWND) -- 548 rather than N/2, allowing high-priority streams to write as 549 much as can be sent.) 550 - If the stream is not the highest priority, try to place the 551 data onto the reserved N/2 queue or fail. 552 - When tick occurs *and* more packets can be scheduled: 553 - Transfer packets from the high N/2 queue to the scheduled 554 queue. 555 - If more scheduling is allowed: 556 - Call on_write callbacks for highest-priority streams, 557 placing resulting packets directly onto the scheduled queue. 558 - If more scheduling is allowed: 559 - Transfer packets from the low N/2 queue to the scheduled 560 queue. 561 - If more scheduling is allowed: 562 - Call on_write callbacks for non-highest-priority streams, 563 placing resulting packets directly onto the scheduled queue 564 565 The number N is currently 20, but it could be varied based on 566 resource usage. 567 568 - If stream is created due to incoming headers, make headers readable 569 from on_new. 570 571 - Outgoing packets are no longer marked non-writeable to prevent placing 572 more than one STREAM frame from the same stream into a single packet. 573 This property is maintained via code flow and an explicit check. 574 Packets for stream data are allocated using a special function. 575 576 - STREAM frame elision is cheaper, as we only perform it if a reset 577 stream has outgoing packets referencing it. 578 579 - lsquic_packet_out_t is smaller, as stream_rec elements are now 580 inside a union. 581 5822017-10-12 583 584 - Do not send RST_STREAM when stream is closed for reading 585 - Raise maximum header size from 4K to 64K 586 - Check header name and value lengths against maximum imposed by HPACK 587 - Fix NULL dereference in stream flow controller 588 5892017-10-09 590 591 - Hide handshake implementation behind a set of function pointers 592 - Use monotonically increasing clock 593 - Make sure that retx delay is not larger than the max of 60 seconds 594 5952017-09-29 596 597 - A few fixes to code and README 598 5992017-09-28 600 601 - Add support for Q041; drop support for Q040 602 6032017-09-27 604 605 - Fix CMakeLists.txt: BoringSSL include and lib was mixed up 606 6072017-09-26 608 609 - Add support for Mac OS 610 - Add support for Raspberry Pi 611 - Fix BoringSSL compilation: include <openssl/hmac.h> explicitly 612 6132017-09-22 614 615 - Initial release 616