Summary:
There are many files in this diff, but the relevant ones are:
* quic/api/QuicSocket.h
* quic/api/QuicSocketLite.h
* quic/api/QuicTransportBase.h
* quic/api/QuicTransportBaseLite.cpp
* quic/observer/SocketObserverContainer.h
The purpose of this is to include the observer functionality within the Lite class. Ideally, we'd remove it from the Lite class, but that's going to require some more detailed changes to the interfaces we're using, because observers are used quite a lot within common code (for example, AckHandlers.cpp).
I'll make those changes some time after the QuicTransportBase split, as they're going to take a while.
Reviewed By: jbeshay, mjoras, kvtsoy
Differential Revision: D65685667
fbshipit-source-id: feb07bcf35d6af2e5c2b538ff463b01b67c6aff9
Summary:
We originally added it for onNetworkDdata only e.g.
https://fburl.com/code/lub7h950, but we should do it on sending pings as well
Reviewed By: mjoras
Differential Revision: D63670960
fbshipit-source-id: ad6096ddc92f00669239bcbb37e65d48238020b9
Summary: This case was missing. If we don't do this then if we buffer a packet on EAGAIN while we don't have initia/handshake data to write, we will loop on the write callback and do empty write loops.
Reviewed By: kvtsoy
Differential Revision: D63492172
fbshipit-source-id: 94ac1c37b2015d38694b9aa3be2744c9bbbe6bee
Summary:
fixes the arg passed to the ::onBidirectionalStreamsAvailable callback
#facebook:
i accidentally introduced a bad operator precedence bug in a refactor; this fixes that and the unit test
luckily HQSession doesn't consume the argument passed to the callback
Reviewed By: knekritz
Differential Revision: D62765762
fbshipit-source-id: 7ae206d5036fc744485736f92fd366ce99103d58
Summary: Delay writes when networkDataPerSocketRead=true until the read loop is done
Reviewed By: mjoras
Differential Revision: D62302229
fbshipit-source-id: 858bed523b5a46bd52fe71f6f0e8b23f5dd4e46d
Summary: Presently updateWriteLooper will always schedule a loop callback to do the write loop. Add an option to inline trigger the writes after the read event.
Reviewed By: kvtsoy, sharmafb
Differential Revision: D62192192
fbshipit-source-id: 30991608f57fbfa097a7522c0731d25b8e528345
Summary: Missed this call because processCallbacksAfterNetworkData() used to call it before
Reviewed By: mjoras
Differential Revision: D61891333
fbshipit-source-id: 078e9dce5e5f91f389bdb38b0a589a3256dd873b
Summary: The prior `while (maxOffsetToDeliver.has_value()) {` was misleading because `maxOffsetToDeliver` doesn't change in the body of the while loop. I'm changing the structure so as to make it more intuitive as to what's happening here.
Reviewed By: hanidamlaj
Differential Revision: D61801508
fbshipit-source-id: fb91b183316b281cf74cbb33a67f7080e7d8a6f8
Summary: I'm adding the software rx timestamp to `PacketsReceivedEvent` so that it's available in `SocketObserverInterface::packetsReceived`.
Reviewed By: mjoras
Differential Revision: D61485649
fbshipit-source-id: 05170acbcfd1fc8e6a2fce4d2cc8f3f2f7441134
Summary: This gives an option to process application callbacks per received and processed packet, rather than after a whole batch has been received.
Reviewed By: kvtsoy
Differential Revision: D61626616
fbshipit-source-id: cac434adff79eda738c2c4924a0080ecdaac1a25
Summary: We have a lot of optionals that are either integral values or std::chrono::microseconds. These end up wasting memory, where we can instead store sentinel values to encode whether the value is there or not. This reduces the effective range of the type by one value, but that is an acceptable tradeoff.
Reviewed By: kvtsoy
Differential Revision: D57684368
fbshipit-source-id: b406b86011f9b8169b6e5e925265f4829928cc63
Summary:
The idea here is to make it so we can swap out the type we are using for optionality. In the near term we are going to try swapping towards one that more aggressively tries to save size.
For now there is no functional change and this is just a big aliasing diff.
Reviewed By: sharmafb
Differential Revision: D57633896
fbshipit-source-id: 6eae5953d47395b390016e59cf9d639f3b6c8cfe
Summary:
Adds a transport setting for the dscp value. The transport combines this value with the ECN flags to enable ECT0/ECT1 marking.
Previous use-cases that are setting dscp values by overriding the whole ToS field should still work, but they will override the ECN bits. This is still the default behavior. Applications willing to use ECN, should use the dscp transport setting instead of applying the tos socket option directly.
Reviewed By: mjoras
Differential Revision: D58203586
fbshipit-source-id: 7dd83ca82273fadd4ae03b015387143e02101b6c
Summary:
There are still some timestamps seen on dynamic content/connections and disabling timestamps per hostname doesn't scale well.
Instead, this diff will disable timestamps by default in Liger and enable only for static content connections based on a hostname filter (`scontent`, `video`, `cdninstagram`). The actual meat of the change is in `AdvancedHTTPSessionManager::shouldEnableQuicAckRxTimestamps` - everything else is mostly a replacement of disable to enable.
This is implemented for MNS in D58099124.
Reviewed By: jbeshay
Differential Revision: D58099125
fbshipit-source-id: 06118163fcc5d2e2ce90028810d6a9af5c7958a9
Summary: We can throw in `writeSocketDataAndCatch()` and that would result in transport closure with drain (with drain keeping the socket alive), but the congestion controller would be reset in close: https://fburl.com/code/zxwfye5u and `maybeStopWriteLooperAndArmSocketWritableEvent()` trips over it later when executed in scope exit.
Reviewed By: mjoras
Differential Revision: D57728369
fbshipit-source-id: 51a4719ae97fab0e90e3ae093a3f56be5a096aff
Summary:
The existing batch writers do not handle failed writes to the AsyncUDPSocket. A packet that fails to be written is detected as a packet loss later when feedback is received from the peer. This negatively impacts the congestion controller because of the fake loss signal, and artificially inflates the number of retransmitted packets/bytes.
This change adds a new batch writer (SinglePacketBackpressuretBatchWriter) that retains the buffers when a write fails. For subsequent writes, the writer retries the same buffer. No new packets are scheduled until the retried buffer succeeds.
Notes:
- To make sure that retry writes are scheduled, the write callback is installed on the socket when a buffer needs to be retried.
- The retries are for an already scheduled packet. The connection state reflects the timing of the first attempt. This could still have an impact on rtt samples, etc. but it this is a milder impact compared to fake losses/retranmissions.
- Any changes outside of the batch writer only impact the new batch writer. Existing batch writers do not use the fields and are not affected by the changes in this diff.
Reviewed By: kvtsoy
Differential Revision: D57597576
fbshipit-source-id: 9476d71ce52e383c5946466f64bb5eecd4f5d549
Summary: Use writable events on the socket (disabled by default)
Reviewed By: jbeshay
Differential Revision: D56305786
fbshipit-source-id: f04dea326587268c96915f7a39338ff21dee4aec
Summary: Adding another WriteCallback in the next diff
Reviewed By: jbeshay
Differential Revision: D56371737
fbshipit-source-id: 4918ca2af3e49968ca0822d7a99309a05021fd10