1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-07 22:46:22 +03:00

Add option to do an inline write after a read event.

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
This commit is contained in:
Matt Joras
2024-09-04 15:15:22 -07:00
committed by Facebook GitHub Bot
parent a87f7bdbcb
commit e81c40b2f7
5 changed files with 16 additions and 6 deletions

View File

@@ -1114,7 +1114,7 @@ void QuicTransportBase::updatePeekLooper() {
}
}
void QuicTransportBase::updateWriteLooper(bool thisIteration) {
void QuicTransportBase::updateWriteLooper(bool thisIteration, bool runInline) {
if (closeState_ == CloseState::CLOSED) {
VLOG(10) << nodeToString(conn_->nodeType)
<< " stopping write looper because conn closed " << *this;
@@ -1141,7 +1141,7 @@ void QuicTransportBase::updateWriteLooper(bool thisIteration) {
VLOG(10) << nodeToString(conn_->nodeType)
<< " running write looper thisIteration=" << thisIteration << " "
<< *this;
writeLooper_->run(thisIteration);
writeLooper_->run(thisIteration, runInline);
if (conn_->loopDetectorCallback) {
conn_->writeDebugState.needsWriteLoopDetect =
(conn_->loopDetectorCallback != nullptr);
@@ -1878,7 +1878,7 @@ void QuicTransportBase::onNetworkData(
checkForClosedStream();
updateReadLooper();
updatePeekLooper();
updateWriteLooper(true);
updateWriteLooper(true, conn_->transportSettings.inlineWriteAfterRead);
};
try {
conn_->lossState.totalBytesRecvd += networkData.getTotalData();