15 HTTPException getException(
const std::string& msg) {
28 recvWindow_(codec->getDefaultWindowSize()),
29 sendWindow_(codec->getDefaultWindowSize()),
31 sendsBlocked_(false) {
32 if (recvCapacity > 0) {
34 VLOG(4) <<
"Ignoring low conn-level recv window size of " << recvCapacity;
37 VLOG(4) <<
"Incrementing default conn-level recv window by " << delta;
47 VLOG(4) <<
"Ignoring low conn-level recv window size of " << capacity;
54 VLOG(4) <<
"Refusing to shrink the recv window";
57 VLOG(4) <<
"Incrementing default conn-level recv window by " << delta;
59 VLOG(2) <<
"Failed setting conn-level recv window capacity to " << capacity;
64 call_->generateWindowUpdate(writeBuf, 0, delta);
72 bool willAck = (
toAck_ > 0 &&
74 VLOG(4) <<
"processed " << delta <<
" toAck_=" <<
toAck_ 75 <<
" bytes, will ack=" << willAck;
93 return call_->isReusable();
97 std::unique_ptr<folly::IOBuf> chain,
103 folly::to<std::string>(
104 "Failed to reserve receive window, window size=",
109 VLOG(4) <<
"recvWindow full";
120 VLOG(4) <<
"Remote side ack'd " << amount <<
" bytes, sendWindow=" <<
123 LOG(WARNING) <<
"Remote side sent connection-level WINDOW_UPDATE " 124 <<
"that could not be applied. Aborting session.";
129 folly::to<std::string>(
130 "Failed to update send window, outstanding=",
135 VLOG(4) <<
"Send window opened";
141 callback_->onWindowUpdate(stream, amount);
147 std::unique_ptr<folly::IOBuf> chain,
150 uint8_t padLen = padding ? *padding : 0;
157 CHECK(success) <<
"Session-level send window underflowed! " 158 <<
"Too much data sent without WINDOW_UPDATES!";
162 VLOG(4) <<
"Send window closed";
167 return call_->generateBody(writeBuf, stream,
std::move(chain), padding,
174 CHECK(stream) <<
" someone tried to manually manipulate a conn-level window";
175 return call_->generateWindowUpdate(writeBuf, stream, delta);
uint32_t getCapacity() const
void onBody(StreamID stream, std::unique_ptr< folly::IOBuf > chain, uint16_t padding) override
void setReceiveWindowSize(folly::IOBufQueue &writeBuf, uint32_t capacity)
size_t generateWindowUpdate(folly::IOBufQueue &writeBuf, StreamID stream, uint32_t delta) override
uint32_t getOutstanding() const
constexpr detail::Map< Move > move
void onWindowUpdate(StreamID stream, uint32_t amount) override
bool reserve(uint32_t amount, bool strict=true)
void writeBuf(const Buf &buf, folly::io::Appender &out)
virtual void onConnectionSendWindowClosed()=0
virtual uint32_t getDefaultWindowSize() const
uint32_t getDefaultWindowSize() const override
FlowControlFilter(Callback &callback, folly::IOBufQueue &writeBuf, HTTPCodec *codec, uint32_t recvCapacity=0)
std::size_t computeChainDataLength() const
bool setCapacity(uint32_t capacity)
virtual void onConnectionSendWindowOpen()=0
bool isReusable() const override
uint32_t getAvailableSend() const
virtual size_t generateWindowUpdate(folly::IOBufQueue &, StreamID, uint32_t)
bool free(uint32_t amount)
size_t generateBody(folly::IOBufQueue &writeBuf, StreamID stream, std::unique_ptr< folly::IOBuf > chain, folly::Optional< uint8_t > padding, bool eom) override
bool ingressBytesProcessed(folly::IOBufQueue &writeBuf, uint32_t delta)
uint32_t getNonNegativeSize() const