Skip to content

Commit 202f3e3

Browse files
zertoshfacebook-github-bot
authored andcommitted
Apply clang-format 18
Summary: Previously this code conformed from clang-format 12. Reviewed By: igorsugak Differential Revision: D56065247 fbshipit-source-id: f5a985dd8f8b84f2f9e1818b3719b43c5a1b05b3
1 parent b6d1b81 commit 202f3e3

15 files changed

+48
-51
lines changed

proxygen/lib/dns/CAresResolver.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -778,9 +778,8 @@ void CAresResolver::resolveAddress(DNSResolver::ResolutionCallback* cb,
778778
std::chrono::milliseconds timeout) {
779779
if (timeout > kMaxTimeout) {
780780
LOG(WARNING) << "Attempt to resolve " << address.getAddressStr()
781-
<< " specified with "
782-
<< "timeout of " << timeout.count() << "ms; "
783-
<< "clamping to " << kMaxTimeout.count() << "ms";
781+
<< " specified with " << "timeout of " << timeout.count()
782+
<< "ms; " << "clamping to " << kMaxTimeout.count() << "ms";
784783
timeout = kMaxTimeout;
785784
}
786785

@@ -956,9 +955,8 @@ void CAresResolver::resolveMailExchange(DNSResolver::ResolutionCallback* cb,
956955
std::chrono::milliseconds timeout) {
957956
if (timeout > kMaxTimeout) {
958957
LOG(WARNING) << "Attempt to resolve mail exchange info for " << domain
959-
<< " specified with "
960-
<< "timeout of " << timeout.count() << "ms; "
961-
<< "clamping to " << kMaxTimeout.count() << "ms";
958+
<< " specified with " << "timeout of " << timeout.count()
959+
<< "ms; " << "clamping to " << kMaxTimeout.count() << "ms";
962960
timeout = kMaxTimeout;
963961
}
964962

proxygen/lib/dns/DNSResolver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class DNSResolver : public folly::DelayedDestruction {
7373
/**
7474
* Status codes for resolution failures.
7575
*/
76-
// clang-format off
76+
// clang-format off
7777
#define DNSRESOLVER_RESOLUTION_STATUS_GEN(xx) \
7878
xx(OK, "Success") \
7979
xx(TIMEOUT, "Timed out") \

proxygen/lib/dns/test/FutureDNSResolverTest.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ TEST_F(FutureDNSResolverTest, TestResolveAddressSuccess) {
188188

189189
TEST_F(FutureDNSResolverTest, TestResolveAddressFail) {
190190
auto addr = folly::SocketAddress(folly::IPAddress("6.7.8.9"), 0);
191-
EXPECT_THROW({ resolver_->resolveAddress(addr).getVia(evb_); },
192-
FakeResolverError);
191+
EXPECT_THROW(
192+
{ resolver_->resolveAddress(addr).getVia(evb_); }, FakeResolverError);
193193
}
194194

195195
TEST_F(FutureDNSResolverTest, TestResolveHostnameSuccess) {
@@ -207,8 +207,9 @@ TEST_F(FutureDNSResolverTest, TestResolveHostnameSuccess) {
207207
}
208208

209209
TEST_F(FutureDNSResolverTest, TestResolveHostnameFail) {
210-
EXPECT_THROW({ resolver_->resolveHostname("unknown-host.com").getVia(evb_); },
211-
FakeResolverError);
210+
EXPECT_THROW(
211+
{ resolver_->resolveHostname("unknown-host.com").getVia(evb_); },
212+
FakeResolverError);
212213
}
213214

214215
TEST_F(FutureDNSResolverTest, TestResolveMailExchangeSuccess) {

proxygen/lib/http/HTTPHeaders.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,19 @@ void HTTPHeaders::add(HTTPHeaderCode code, T&& value) {
460460
#define ITERATE_OVER_STRINGS(String, Block) \
461461
ITERATE_OVER_CODES(HTTP_HEADER_OTHER, { \
462462
if (caseInsensitiveEqual((String), *names()[pos])) { \
463-
{ Block } \
463+
{ \
464+
Block \
465+
} \
464466
} \
465467
})
466468

467469
// iterate over the positions of all headers with given name ignoring - and _
468470
#define ITERATE_OVER_STRINGS_ALL_VERSION(String, Block) \
469471
ITERATE_OVER_CODES(HTTP_HEADER_OTHER, { \
470472
if (caseUnderscoreInsensitiveEqual((String), *names()[pos])) { \
471-
{ Block } \
473+
{ \
474+
Block \
475+
} \
472476
} \
473477
})
474478

proxygen/lib/http/codec/DefaultHTTPCodecFactory.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ std::unique_ptr<HTTPCodec> DefaultHTTPCodecFactory::getCodec(
3838
} else {
3939
if (!chosenProto.empty() &&
4040
!HTTP1xCodec::supportsNextProtocol(chosenProto)) {
41-
LOG(ERROR) << "Chosen upstream protocol "
42-
<< "\"" << chosenProto << "\" is unimplemented. "
43-
<< "Attempting to use HTTP/1.1";
41+
LOG(ERROR) << "Chosen upstream protocol " << "\"" << chosenProto
42+
<< "\" is unimplemented. " << "Attempting to use HTTP/1.1";
4443
}
4544

4645
return std::make_unique<HTTP1xCodec>(

proxygen/lib/http/codec/HTTP1xCodec.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,9 +1152,8 @@ int HTTP1xCodec::onHeadersComplete(size_t len) {
11521152
const std::string& accept =
11531153
hdrs.getSingleOrEmpty(HTTP_HEADER_SEC_WEBSOCKET_ACCEPT);
11541154
if (accept != websockAcceptKey_) {
1155-
LOG(ERROR) << "Mismatch in expected ws accept key: "
1156-
<< "upstream: " << accept
1157-
<< " expected: " << websockAcceptKey_;
1155+
LOG(ERROR) << "Mismatch in expected ws accept key: " << "upstream: "
1156+
<< accept << " expected: " << websockAcceptKey_;
11581157
return -1;
11591158
}
11601159
} else {

proxygen/lib/http/connpool/test/SessionPoolTestFixture.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class SessionPoolFixture
142142
void onBody(std::unique_ptr<folly::IOBuf> /*chain*/) noexcept override {
143143
}
144144
void onChunkHeader(size_t /*length*/) noexcept override{};
145-
void onChunkComplete() noexcept override{};
145+
void onChunkComplete() noexcept override {};
146146
void onTrailers(std::unique_ptr<HTTPHeaders> /*trailers*/) noexcept override {
147147
}
148148
void onEOM() noexcept override {

proxygen/lib/http/session/HQDownstreamSession.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class HQDownstreamSession : public HQSession {
164164

165165
private:
166166
hq::PushId pushId_; // The push id in context of which this stream is sent
167-
}; // HQEgressPushStream
167+
}; // HQEgressPushStream
168168
#ifdef _MSC_VER
169169
#pragma warning(pop)
170170
#endif

proxygen/lib/http/session/HQSession.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ void HQSession::onStopSending(quic::StreamId id,
260260
void HQSession::onKnob(uint64_t knobSpace,
261261
uint64_t knobId,
262262
quic::Buf knobBlob) {
263-
VLOG(3) << __func__ << " sess=" << *this << " knob frame received: "
264-
<< " KnobSpace: " << std::hex << knobSpace << " KnobId: " << knobId
265-
<< " KnobBlob: "
263+
VLOG(3) << __func__ << " sess=" << *this
264+
<< " knob frame received: " << " KnobSpace: " << std::hex << knobSpace
265+
<< " KnobId: " << knobId << " KnobBlob: "
266266
<< std::string(reinterpret_cast<const char*>(knobBlob->data()),
267267
knobBlob->length());
268268
}
@@ -1157,8 +1157,7 @@ void HQSession::readAvailable(quic::StreamId id) noexcept {
11571157
<< ": readAvailable on streamID=" << id;
11581158
if (readsPerLoop_ >= kMaxReadsPerLoop) {
11591159
VLOG(2) << __func__ << ": skipping read for streamID=" << id
1160-
<< " maximum reads per loop reached"
1161-
<< " sess=" << *this;
1160+
<< " maximum reads per loop reached" << " sess=" << *this;
11621161
return;
11631162
}
11641163
readsPerLoop_++;

proxygen/lib/http/session/HQUpstreamSession.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,8 @@ class HQUpstreamSession : public HQSession {
159159
void onPushMessageBegin(HTTPCodec::StreamID pushId,
160160
HTTPCodec::StreamID parentTxnId,
161161
HTTPMessage* /* msg */) override {
162-
LOG(ERROR) << "Push promise on push stream"
163-
<< " txn=" << txn_ << " pushID=" << pushId
164-
<< " parentTxnId=" << parentTxnId;
162+
LOG(ERROR) << "Push promise on push stream" << " txn=" << txn_
163+
<< " pushID=" << pushId << " parentTxnId=" << parentTxnId;
165164
session_.dropConnectionAsync(
166165
quic::QuicError(HTTP3::ErrorCode::HTTP_FRAME_UNEXPECTED,
167166
"Push promise on push stream"),
@@ -193,7 +192,7 @@ class HQUpstreamSession : public HQSession {
193192
private:
194193
hq::PushId pushId_; // The push id in context of which this stream is
195194
// received
196-
}; // HQIngressPushStream
195+
}; // HQIngressPushStream
197196

198197
#ifdef _MSC_VER
199198
#pragma warning(pop)

proxygen/lib/http/session/HTTPTransaction.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,10 +1499,9 @@ void HTTPTransaction::sendEOM() {
14991499
<< "ingressState=" << ingressState_ << ", "
15001500
<< "egressPaused=" << egressPaused_ << ", "
15011501
<< "ingressPaused=" << ingressPaused_ << ", "
1502-
<< "aborted=" << aborted_ << ", "
1503-
<< "enqueued=" << isEnqueued() << ", "
1504-
<< "chainLength=" << deferredEgressBody_.chainLength() << ", "
1505-
<< "bufferMetaLen=" << deferredBufferMeta_.length << "]"
1502+
<< "aborted=" << aborted_ << ", " << "enqueued=" << isEnqueued()
1503+
<< ", " << "chainLength=" << deferredEgressBody_.chainLength()
1504+
<< ", " << "bufferMetaLen=" << deferredBufferMeta_.length << "]"
15061505
<< " on " << *this;
15071506
}
15081507
} else {

proxygen/lib/http/session/test/MockHTTPSessionStats.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ namespace proxygen {
1515

1616
class DummyHTTPSessionStats : public HTTPSessionStats {
1717
public:
18-
void recordTransactionOpened() noexcept override{};
19-
void recordTransactionClosed() noexcept override{};
18+
void recordTransactionOpened() noexcept override {};
19+
void recordTransactionClosed() noexcept override {};
2020
void recordTransactionsServed(uint64_t) noexcept override{};
21-
void recordSessionReused() noexcept override{};
21+
void recordSessionReused() noexcept override {};
2222
// virtual void recordSessionIdleTime(std::chrono::seconds) noexcept {};
23-
void recordTransactionStalled() noexcept override{};
23+
void recordTransactionStalled() noexcept override {};
2424
void recordSessionStalled() noexcept override {
2525
}
2626
void recordEgressContentLengthMismatches() noexcept override {

proxygen/lib/http/session/test/MockQuicSocketDriver.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ class MockQuicSocketDriver : public folly::EventBase::LoopCallback {
10941094
fmt::format("write callback not set when calling "
10951095
"onConnectionWriteReady for streamId={}",
10961096
id),
1097-
return );
1097+
return);
10981098
auto maxStreamToWrite = maxStreamWritable(id);
10991099
auto maxConnToWrite = maxConnWritable();
11001100
if (!maxConnToWrite && !maxStreamToWrite) {
@@ -1388,7 +1388,7 @@ class MockQuicSocketDriver : public folly::EventBase::LoopCallback {
13881388
events_.emplace_back(std::move(cob));
13891389
eventBase_->runAfterDelay(
13901390
[this] {
1391-
ERROR_IF(events_.empty(), "no events to schedule", return );
1391+
ERROR_IF(events_.empty(), "no events to schedule", return);
13921392
auto event = std::move(events_.front());
13931393
events_.pop_front();
13941394
event();
@@ -1458,7 +1458,7 @@ class MockQuicSocketDriver : public folly::EventBase::LoopCallback {
14581458
std::chrono::milliseconds(0)) {
14591459
ERROR_IF(streams_[kConnectionStreamId].readState == CLOSED,
14601460
"adding read event on CLOSED connection",
1461-
return );
1461+
return);
14621462
cumulativeDelay_ += delayFromPrevious;
14631463
runInThisLoopOrAfterDelay(
14641464
[events = std::move(events), this, deleted = deleted_]() mutable {
@@ -1482,13 +1482,13 @@ class MockQuicSocketDriver : public folly::EventBase::LoopCallback {
14821482
ERROR_IF(stream.readState == CLOSED,
14831483
fmt::format("scheduling event on CLOSED streamId={}",
14841484
event.streamId),
1485-
return );
1485+
return);
14861486
} else {
14871487
ERROR_IF((event.buf && !event.buf->empty()) || event.eof,
14881488
fmt::format("scheduling an error event with either a "
14891489
"buffer or eof on streamId={}",
14901490
event.streamId),
1491-
return );
1491+
return);
14921492
}
14931493
if (event.streamId == kConnectionStreamId &&
14941494
event.datagramsAvailable && !event.error && datagramCB_) {
@@ -1595,7 +1595,7 @@ class MockQuicSocketDriver : public folly::EventBase::LoopCallback {
15951595
auto& connStream = streams_[kConnectionStreamId];
15961596
ERROR_IF(connStream.writeState == CLOSED,
15971597
"setConnectionFlowControlWindow on CLOSED connection",
1598-
return );
1598+
return);
15991599
connStream.flowControlWindow = windowSize;
16001600
if (pauseOrResumeWrites(connStream, kConnectionStreamId) ==
16011601
PauseResumeResult::RESUMED) {
@@ -1619,7 +1619,7 @@ class MockQuicSocketDriver : public folly::EventBase::LoopCallback {
16191619

16201620
ERROR_IF(stream.writeState == CLOSED,
16211621
"setStreamFlowControlWindow on CLOSED connection",
1622-
return );
1622+
return);
16231623
stream.flowControlWindow = windowSize;
16241624
pauseOrResumeWrites(stream, streamId);
16251625
}
@@ -1628,7 +1628,7 @@ class MockQuicSocketDriver : public folly::EventBase::LoopCallback {
16281628
auto& stream = streams_[streamId];
16291629
ERROR_IF(stream.writeState != OPEN,
16301630
fmt::format("pauseWrites on not OPEN streamId={}", streamId),
1631-
return );
1631+
return);
16321632
stream.writeState = PAUSED;
16331633
}
16341634

@@ -1645,7 +1645,7 @@ class MockQuicSocketDriver : public folly::EventBase::LoopCallback {
16451645
auto& stream = streams_[streamId];
16461646
ERROR_IF(stream.writeState != PAUSED && !connFCEvent,
16471647
fmt::format("resumeWrites on not PAUSED streamId={}", streamId),
1648-
return );
1648+
return);
16491649
stream.writeState = OPEN;
16501650
// first flush any buffered writes
16511651
flushWrites(streamId);

proxygen/lib/http/test/MockHTTPHeaders.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class HasHTTPHeaderMatcherImpl
6262
if (!value_) {
6363
*os << "does not have the '" << name_ << "' header";
6464
} else {
65-
*os << "does not have the '" << name_ << "' header "
66-
<< "equal to '" << *value_ << "'";
65+
*os << "does not have the '" << name_ << "' header " << "equal to '"
66+
<< *value_ << "'";
6767
}
6868
}
6969

proxygen/lib/utils/URL.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ class URL {
8888
uint16_t port = 0,
8989
const std::string& path = "",
9090
const std::string& query = "",
91-
const std::string& fragment = "")
92-
noexcept
91+
const std::string& fragment = "") noexcept
9392
: host_(host),
9493
port_(port),
9594
path_(path),

0 commit comments

Comments
 (0)