mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-27 03:41:14 +03:00
move qlog to transport lite
Summary: Context: T210787480 I want to add a client-side qlog that will allow us to inspect client behavior during the 0rtt bug. Reviewed By: jbeshay Differential Revision: D71145234 fbshipit-source-id: 7816f0a759ba4f60107aaf40c4376ced7c5d03f8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
955f05f42b
commit
aa90d99d76
@@ -57,40 +57,6 @@ void QuicTransportBase::setPacingTimer(
|
||||
}
|
||||
}
|
||||
|
||||
const std::shared_ptr<QLogger> QuicTransportBase::getQLogger() const {
|
||||
return conn_->qLogger;
|
||||
}
|
||||
|
||||
void QuicTransportBase::setQLogger(std::shared_ptr<QLogger> qLogger) {
|
||||
// setQLogger can be called multiple times for the same connection and with
|
||||
// the same qLogger we track the number of times it gets set and the number
|
||||
// of times it gets reset, and only stop qlog collection when the number of
|
||||
// resets equals the number of times the logger was set
|
||||
if (!conn_->qLogger) {
|
||||
CHECK_EQ(qlogRefcnt_, 0);
|
||||
} else {
|
||||
CHECK_GT(qlogRefcnt_, 0);
|
||||
}
|
||||
|
||||
if (qLogger) {
|
||||
conn_->qLogger = std::move(qLogger);
|
||||
conn_->qLogger->setDcid(conn_->clientChosenDestConnectionId);
|
||||
if (conn_->nodeType == QuicNodeType::Server) {
|
||||
conn_->qLogger->setScid(conn_->serverConnectionId);
|
||||
} else {
|
||||
conn_->qLogger->setScid(conn_->clientConnectionId);
|
||||
}
|
||||
qlogRefcnt_++;
|
||||
} else {
|
||||
if (conn_->qLogger) {
|
||||
qlogRefcnt_--;
|
||||
if (qlogRefcnt_ == 0) {
|
||||
conn_->qLogger = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Optional<ConnectionId> QuicTransportBase::getClientConnectionId() const {
|
||||
return conn_->clientConnectionId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user