Skip to content

Commit 99fc481

Browse files
committed
quic: Fix linting 3
1 parent ad7e2fa commit 99fc481

File tree

4 files changed

+30
-18
lines changed

4 files changed

+30
-18
lines changed

src/dataqueue/queue.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,11 @@ class NonIdempotentDataQueueReader final
450450
status == bob::Status::STATUS_EOS,
451451
vecs == nullptr && count == 0);
452452
if (status == bob::Status::STATUS_EOS) {
453-
current_reader_ = nullptr; // must be done before erasing the entries
454-
// as FdEntry's and FeederEntry's reader hold a pointer to the entry!
455-
// and FeederEntry invoke it in destructor
453+
current_reader_ = nullptr;
454+
// must be done before erasing the entries
455+
// as FdEntry's and FeederEntry's reader hold
456+
// a pointer to the entry! and FeederEntry
457+
// invoke it in destructor
456458
data_queue_->entries_.erase(data_queue_->entries_.begin());
457459
ended_ = data_queue_->entries_.empty();
458460
if (!ended_) status = bob::Status::STATUS_CONTINUE;

src/quic/session.cc

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ struct Session::Impl final : public MemoryRetainer {
542542
remote_address_(config.remote_address),
543543
application_(SelectApplication(session, config_)),
544544
timer_(session_->env(), [this] {
545-
auto impl = session_->impl_; // we hold a reference to ourself,
545+
auto impl = session_->impl_; // we hold a reference to ourself,
546546
// as the reference from session to us may go away
547547
// while we call OnTimeout
548548
session_->OnTimeout();
@@ -565,15 +565,15 @@ struct Session::Impl final : public MemoryRetainer {
565565
// we hold a reference to ourself,
566566
// as the reference from session to us may go away
567567
// while we destroy streams
568-
auto impl = session_->impl_;
568+
auto impl = session_->impl_;
569569

570570
// Iterate through all of the known streams and close them. The streams
571571
// will remove themselves from the Session as soon as they are closed.
572572
// Note: we create a copy because the streams will remove themselves
573573
// while they are cleaning up which will invalidate the iterator.
574574
StreamsMap streams = streams_;
575575
for (auto& stream : streams) stream.second->Destroy(last_error_);
576-
DCHECK(streams_.empty()); // do not check our local copy
576+
DCHECK(streams_.empty()); // do not check our local copy
577577

578578
// Clear the pending streams.
579579
while (!pending_bidi_stream_queue_.IsEmpty()) {
@@ -1410,7 +1410,8 @@ void Session::Close(CloseMethod method) {
14101410

14111411
// This is done already in the implmentation
14121412
// STAT_RECORD_TIMESTAMP(Stats, closing_at);
1413-
// The next line would be prevent, that close of the implementation is executed!
1413+
// The next line would prevent,
1414+
// that close of the implementation is executed!
14141415
// impl_->state_->closing = 1;
14151416

14161417
// With both the DEFAULT and SILENT options, we will proceed to closing
@@ -1459,12 +1460,15 @@ void Session::Close(CloseMethod method) {
14591460
}
14601461

14611462
void Session::FinishClose() {
1462-
if (impl_->state_->finish_closing) return; // we were already called, avoids calling it twice
1463+
if (impl_->state_->finish_closing) return;
1464+
// we were already called, avoids calling it twice
14631465
impl_->state_->finish_closing = 1;
1464-
// FinishClose() should be called only after, and as a result of, Close()
1466+
// FinishClose() should be called only after,
1467+
// and as a result of, Close()
14651468
// being called first.
14661469
DCHECK(!is_destroyed());
1467-
// The next line does not make sense, as in the implementation is also checking if closing is not in progress
1470+
// The next line does not make sense, as in the implementation
1471+
// is also checking if closing is not in progress
14681472
// DCHECK(impl_->state_->closing);
14691473

14701474
// If impl_->Close() returns true, then the session can be destroyed
@@ -1479,11 +1483,12 @@ void Session::FinishClose() {
14791483
}
14801484

14811485
void Session::Destroy() {
1482-
// Destroy() should be called only after, and as a result of, Close()
1486+
// Destroy() should be called only after,
1487+
// and as a result of, Close()
14831488
// being called first.
14841489
DCHECK(impl_);
14851490
DCHECK(impl_->state_->closing);
1486-
Debug(this, "Session destroyed");
1491+
Debug(this, "Session destroyed");
14871492
if (qlog_stream_ || keylog_stream_) {
14881493
env()->SetImmediate(
14891494
[qlog = qlog_stream_, keylog = keylog_stream_](Environment*) {
@@ -2109,7 +2114,8 @@ void Session::RemoveStream(stream_id id) {
21092114
// returns.
21102115
if (impl_->state_->closing && impl_->state_->graceful_close) {
21112116
FinishClose();
2112-
// CHECK(is_destroyed()); // this will not work, our this pointer may not be valid anymore!
2117+
// CHECK(is_destroyed());
2118+
// this will not work, our this pointer may not be valid anymore!
21132119
}
21142120
}
21152121

src/quic/session.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,11 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source {
497497

498498
Side side_;
499499
ngtcp2_mem allocator_;
500-
std::shared_ptr<Impl> impl_; // we need to have a shared ptr, there are situations
501-
// where Impl calls the session and the session resets this pointer to Impl,
502-
// in this case we need to hold a local shared ptr to prevent use after free
500+
std::shared_ptr<Impl> impl_; // we need to have a shared ptr,
501+
// there are situations, where Impl calls the session and
502+
// the session resets this pointer to Impl,
503+
// in this case we need to hold a local shared ptr
504+
// to prevent use after free
503505
QuicConnectionPointer connection_;
504506
std::unique_ptr<TLSSession> tls_session_;
505507
BaseObjectPtr<LogStream> qlog_stream_;

src/quic/streams.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,9 @@ void DataQueueFeeder::tryWakePulls() {
13491349

13501350
void DataQueueFeeder::DrainAndClose() {
13511351
if (done) return;
1352-
done = true; // do not do this several time, and note, it may be called several times.
1352+
done = true;
1353+
// do not do this several time, and note,
1354+
// it may be called several times.
13531355
while (!pendingPulls_.empty()) {
13541356
auto& pending = pendingPulls_.front();
13551357
auto pop = OnScopeLeave([this] { pendingPulls_.pop_front(); });
@@ -1393,7 +1395,7 @@ JS_METHOD_IMPL(DataQueueFeeder::Submit) {
13931395
if (args[1]->IsBoolean() && args[1].As<v8::Boolean>()->Value()) {
13941396
done = true;
13951397
}
1396-
if (!args[0].IsEmpty() &&
1398+
if (!args[0].IsEmpty() &&
13971399
!args[0]->IsUndefined() && !args[0]->IsNull()) {
13981400
CHECK_GT(feeder->pendingPulls_.size(), 0);
13991401
auto chunk = args[0];

0 commit comments

Comments
 (0)