Skip to content

Commit fb63756

Browse files
committed
fixes
1 parent 07c70ac commit fb63756

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/src/Http2Transport.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ void Http2Transport::sendRequestInLoop(const HttpRequestPtr &req,
678678
{
679679
connPtr->getLoop()->assertInLoopThread();
680680
Defer d([this]() { sendBufferedData(); });
681-
if (streams.size() + 1 >= maxConcurrentStreams)
681+
if (streams.size() + 1 > maxConcurrentStreams)
682682
{
683683
LOG_TRACE << "Too many streams in flight. Buffering request";
684684
bufferedRequests.push({req, std::move(callback)});
@@ -1045,7 +1045,7 @@ void Http2Transport::onRecvMessage(const trantor::TcpConnectionPtr &,
10451045
// If first initial window update received, we need to
10461046
// update all streams' avaliable window size (even if)
10471047
// it is going negative)
1048-
if (firstInitalWindowUpdateReceived)
1048+
if (!firstInitalWindowUpdateReceived)
10491049
{
10501050
continue;
10511051
}
@@ -1310,8 +1310,8 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
13101310
f.headerBlockFragment.size());
13111311
expectngContinuationStreamId = streamId;
13121312
stream.state = isTrailers
1313-
? StreamState::ExpectingContinuation
1314-
: StreamState::ExepectingContinuationTrailers;
1313+
? StreamState::ExpectingContinuationTrailers
1314+
: StreamState::ExpectingContinuation;
13151315
return;
13161316
}
13171317
auto &f = std::get<HeadersFrame>(frame);
@@ -1341,8 +1341,8 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
13411341
else if (std::holds_alternative<ContinuationFrame>(frame))
13421342
{
13431343
auto &f = std::get<ContinuationFrame>(frame);
1344-
if (stream.state == StreamState::ExpectingContinuation ||
1345-
stream.state == StreamState::ExepectingContinuationTrailers)
1344+
if (stream.state != StreamState::ExpectingContinuation &&
1345+
stream.state != StreamState::ExpectingContinuationTrailers)
13461346
{
13471347
connectionErrored(streamId,
13481348
StreamCloseErrorCode::ProtocolError,
@@ -1353,7 +1353,7 @@ void Http2Transport::handleFrameForStream(const internal::H2Frame &frame,
13531353
headerBufferRx.append((char *)f.headerBlockFragment.data(),
13541354
f.headerBlockFragment.size());
13551355
bool isTrailers =
1356-
(stream.state == StreamState::ExepectingContinuationTrailers);
1356+
(stream.state == StreamState::ExpectingContinuationTrailers);
13571357
bool endHeaders = (flags & (uint8_t)H2HeadersFlags::EndHeaders) != 0;
13581358
bool endStream = (flags & (uint8_t)H2HeadersFlags::EndStream) != 0;
13591359

lib/src/Http2Transport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ enum class StreamState
411411
ExpectingHeaders,
412412
ExpectingContinuation,
413413
ExpectingData,
414-
ExepectingContinuationTrailers,
414+
ExpectingContinuationTrailers,
415415
Finished,
416416
};
417417

0 commit comments

Comments
 (0)