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