@@ -158,7 +158,7 @@ std::optional<WindowUpdateFrame> WindowUpdateFrame::parse(ByteStream &payload,
158158 // MSB is reserved for future use
159159 auto [_, windowSizeIncrement] = payload.readBI31BE ();
160160 frame.windowSizeIncrement = windowSizeIncrement;
161- if (frame.windowSizeIncrement == 0 )
161+ if (frame.windowSizeIncrement == 0 )
162162 {
163163 LOG_TRACE << " Flow control error: window size increment cannot be 0" ;
164164 return std::nullopt ;
@@ -253,7 +253,7 @@ bool HeadersFrame::serialize(OByteStream &stream, uint8_t &flags) const
253253 if (endStream)
254254 flags |= (uint8_t )H2HeadersFlags::EndStream;
255255 stream.write (headerBlockFragment.data (), headerBlockFragment.size ());
256- if (padLength > 0 )
256+ if (padLength > 0 )
257257 {
258258 stream.pad (padLength);
259259 }
@@ -333,7 +333,7 @@ std::optional<DataFrame> DataFrame::parse(ByteStream &payload, uint8_t flags)
333333bool DataFrame::serialize (OByteStream &stream, uint8_t &flags) const
334334{
335335 flags = (endStream ? (uint8_t )H2DataFlags::EndStream : 0x0 );
336- if (padLength > 0 )
336+ if (padLength > 0 )
337337 {
338338 flags |= (uint8_t )H2DataFlags::Padded;
339339 stream.writeU8 (padLength);
@@ -430,7 +430,7 @@ bool PushPromiseFrame::serialize(OByteStream &stream, uint8_t &flags) const
430430 flags = 0x0 ;
431431 if (endHeaders)
432432 flags |= (uint8_t )H2HeadersFlags::EndHeaders;
433- if ( padLength > 0 )
433+ if ( padLength > 0 )
434434 {
435435 flags |= (uint8_t )H2HeadersFlags::Padded;
436436 stream.writeU8 (padLength);
@@ -938,14 +938,14 @@ void Http2Transport::onRecvMessage(const trantor::TcpConnectionPtr &,
938938 if (std::holds_alternative<WindowUpdateFrame>(frame))
939939 {
940940 auto &f = std::get<WindowUpdateFrame>(frame);
941- if (std::numeric_limits<decltype (avaliableTxWindow)>::max ()
942- - avaliableTxWindow < f.windowSizeIncrement )
941+ if (std::numeric_limits<decltype (avaliableTxWindow)>::max () -
942+ avaliableTxWindow <
943+ f.windowSizeIncrement )
943944 {
944945 LOG_TRACE << " Flow control error: TX window size overflow" ;
945- connectionErrored (
946- streamId,
947- StreamCloseErrorCode::FlowControlError,
948- " TX window size overflow" );
946+ connectionErrored (streamId,
947+ StreamCloseErrorCode::FlowControlError,
948+ " TX window size overflow" );
949949 break ;
950950 }
951951 avaliableTxWindow += f.windowSizeIncrement ;
@@ -1113,7 +1113,7 @@ bool Http2Transport::parseAndApplyHeaders(internal::H2Stream &stream,
11131113 for (auto &[key, value] : headers)
11141114 LOG_TRACE << " " << key << " : " << value;
11151115 assert (stream.response || !isTrailers);
1116- if (stream.response == nullptr )
1116+ if (stream.response == nullptr )
11171117 {
11181118 stream.response = std::make_shared<HttpResponseImpl>();
11191119 stream.response ->setVersion (Version::kHttp2 );
@@ -1133,12 +1133,11 @@ bool Http2Transport::parseAndApplyHeaders(internal::H2Stream &stream,
11331133 " content-encoding" ,
11341134 " content-type" ,
11351135 " content-range" ,
1136- " trailer"
1137- };
1136+ " trailer" };
11381137 for (const auto &[key, value] : headers)
11391138 {
11401139 bool ok = true ;
1141- if (isTrailers)
1140+ if (isTrailers)
11421141 {
11431142 if (std::find (bannedTrailerHeaders.begin (),
11441143 bannedTrailerHeaders.end (),
@@ -1148,7 +1147,7 @@ bool Http2Transport::parseAndApplyHeaders(internal::H2Stream &stream,
11481147 streamErrored (streamId, ReqResult::BadResponse);
11491148 return false ;
11501149 }
1151- if ( key.front () == ' :' )
1150+ if ( key.front () == ' :' )
11521151 {
11531152 LOG_TRACE << " Pseudo header in trailers: " << key;
11541153 streamErrored (streamId, ReqResult::BadResponse);
@@ -1233,8 +1232,8 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
12331232
12341233 if (std::holds_alternative<HeadersFrame>(frame))
12351234 {
1236- if (stream.state != StreamState::ExpectingHeaders
1237- && stream.state != StreamState::ExpectingData) // Trailers
1235+ if (stream.state != StreamState::ExpectingHeaders &&
1236+ stream.state != StreamState::ExpectingData) // Trailers
12381237 {
12391238 connectionErrored (streamId,
12401239 StreamCloseErrorCode::ProtocolError,
@@ -1250,9 +1249,9 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
12501249 headerBufferRx.append ((char *)f.headerBlockFragment .data (),
12511250 f.headerBlockFragment .size ());
12521251 expectngContinuationStreamId = streamId;
1253- stream.state = isTrailers ?
1254- StreamState::ExpectingContinuation :
1255- StreamState::ExepectingContinuationTrailers;
1252+ stream.state = isTrailers
1253+ ? StreamState::ExpectingContinuation
1254+ : StreamState::ExepectingContinuationTrailers;
12561255 return ;
12571256 }
12581257 auto &f = std::get<HeadersFrame>(frame);
@@ -1271,7 +1270,7 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
12711270 return ;
12721271 }
12731272
1274- if (isTrailers)
1273+ if (isTrailers)
12751274 {
12761275 connectionErrored (streamId,
12771276 StreamCloseErrorCode::ProtocolError,
@@ -1282,7 +1281,7 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
12821281 else if (std::holds_alternative<ContinuationFrame>(frame))
12831282 {
12841283 auto &f = std::get<ContinuationFrame>(frame);
1285- if (stream.state == StreamState::ExpectingContinuation ||
1284+ if (stream.state == StreamState::ExpectingContinuation ||
12861285 stream.state == StreamState::ExepectingContinuationTrailers)
12871286 {
12881287 connectionErrored (streamId,
@@ -1293,19 +1292,19 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
12931292
12941293 headerBufferRx.append ((char *)f.headerBlockFragment .data (),
12951294 f.headerBlockFragment .size ());
1296- bool isTrailers = (stream.state == StreamState::ExepectingContinuationTrailers);
1295+ bool isTrailers =
1296+ (stream.state == StreamState::ExepectingContinuationTrailers);
12971297 bool endHeaders = (flags & (uint8_t )H2HeadersFlags::EndHeaders) != 0 ;
12981298 bool endStream = (flags & (uint8_t )H2HeadersFlags::EndStream) != 0 ;
12991299
1300- if (isTrailers && (endHeaders == true && endStream == false ))
1300+ if (isTrailers && (endHeaders == true && endStream == false ))
13011301 {
13021302 connectionErrored (streamId,
13031303 StreamCloseErrorCode::ProtocolError,
13041304 " Trailers must end header and stream together" );
13051305 return ;
13061306 }
13071307
1308-
13091308 if (endHeaders)
13101309 {
13111310 stream.state = StreamState::ExpectingData;
@@ -1320,7 +1319,7 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
13201319 return ;
13211320 }
13221321
1323- if (endStream)
1322+ if (endStream)
13241323 {
13251324 stream.state = StreamState::Finished;
13261325 responseSuccess (stream);
@@ -1388,14 +1387,14 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
13881387 else if (std::holds_alternative<WindowUpdateFrame>(frame))
13891388 {
13901389 auto &f = std::get<WindowUpdateFrame>(frame);
1391- if (std::numeric_limits<decltype (stream.avaliableTxWindow )>::max ()
1392- - stream.avaliableTxWindow < f.windowSizeIncrement )
1390+ if (std::numeric_limits<decltype (stream.avaliableTxWindow )>::max () -
1391+ stream.avaliableTxWindow <
1392+ f.windowSizeIncrement )
13931393 {
13941394 LOG_TRACE << " Flow control error: stream TX window size overflow" ;
1395- connectionErrored (
1396- streamId,
1397- StreamCloseErrorCode::FlowControlError,
1398- " Stream TX window size overflow" );
1395+ connectionErrored (streamId,
1396+ StreamCloseErrorCode::FlowControlError,
1397+ " Stream TX window size overflow" );
13991398 return ;
14001399 }
14011400 stream.avaliableTxWindow += f.windowSizeIncrement ;
0 commit comments