/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// These internal states track request generation enum upstreamStateType {
GENERATING_HEADERS,
GENERATING_BODY,
SENDING_BODY,
SENDING_FIN_STREAM,
UPSTREAM_COMPLETE
};
uint32_t mStreamID{0};
// The session that this stream is a subset of
nsWeakPtr mSession;
// These are temporary state variables to hold the argument to // Read/WriteSegments so it can be accessed by On(read/write)segment // further up the stack.
RefPtr<nsAHttpSegmentReader> mSegmentReader;
nsAHttpSegmentWriter* mSegmentWriter{nullptr};
// Each stream goes from generating_headers to upstream_complete, perhaps // looping on multiple instances of generating_body and // sending_body for each frame in the upload. enum upstreamStateType mUpstreamState { GENERATING_HEADERS };
// The HTTP/2 state for the stream from section 5.1 enum stateType mState { IDLE };
// Flag is set when all http request headers have been read ID is not stable
uint32_t mRequestHeadersDone : 1;
// Flag is set when ID is stable and concurrency limits are met
uint32_t mOpenGenerated : 1;
// Flag is set when all http response headers have been read
uint32_t mAllHeadersReceived : 1;
// Flag is set when stream is queued inside the session due to // concurrency limits being exceeded
uint32_t mQueued : 1;
// The underlying socket transport object is needed to propogate some events
nsCOMPtr<nsISocketTransport> mSocketTransport;
uint8_t mPriorityWeight = 0; // h2 weight
uint32_t mPriorityDependency = 0; // h2 stream id this one depends on
uint64_t mCurrentBrowserId;
uint64_t mTransactionBrowserId{0};
// The InlineFrame and associated data is used for composing control // frames and data frame headers.
UniquePtr<uint8_t[]> mTxInlineFrame;
uint32_t mTxInlineFrameSize{0};
uint32_t mTxInlineFrameUsed{0};
uint32_t mRFC7540Priority = 0; // geckoish weight
// Buffer for request header compression.
nsCString mFlatHttpRequestHeaders;
// Track the content-length of a request body so that we can // place the fin flag on the last data packet instead of waiting // for a stream closed indication. Relying on stream close results // in an extra 0-length runt packet and seems to have some interop // problems with the google servers. Connect does rely on stream // close by setting this to the max value.
int64_t mRequestBodyLenRemaining{0};
// The quanta upstream data frames are chopped into
uint32_t mChunkSize;
// Flag is set when the HTTP processor has more data to send // but has blocked in doing so.
uint32_t mRequestBlockedOnRead : 1;
// Flag is set after the response frame bearing the fin bit has // been processed. (i.e. after the server has closed).
uint32_t mRecvdFin : 1;
// Flag is set after 1st DATA frame has been passed to stream
uint32_t mReceivedData : 1;
// Flag is set after RST_STREAM has been received for this stream
uint32_t mRecvdReset : 1;
// Flag is set after RST_STREAM has been generated for this stream
uint32_t mSentReset : 1;
// Flag is set when stream is counted towards MAX_CONCURRENT streams in // session
uint32_t mCountAsActive : 1;
// Flag is set when a FIN has been placed on a data or header frame // (i.e after the client has closed)
uint32_t mSentFin : 1;
// Flag is set after the WAITING_FOR Transport event has been generated
uint32_t mSentWaitingFor : 1;
// Flag is set after TCP send autotuning has been disabled
uint32_t mSetTCPSocketBuffer : 1;
// Flag is set when OnWriteSegment is being called directly from stream // instead of transaction
uint32_t mBypassInputBuffer : 1;
// mTxStreamFrameSize tracks the progress of // transmitting a request body data frame. The data frame itself // is never copied into the spdy layer.
uint32_t mTxStreamFrameSize{0};
// mClientReceiveWindow, mServerReceiveWindow, and mLocalUnacked are for flow // control. *window are signed because the race conditions in asynchronous // SETTINGS messages can force them temporarily negative.
// mClientReceiveWindow is how much data the server will send without getting // a // window update
int64_t mClientReceiveWindow;
// mServerReceiveWindow is how much data the client is allowed to send without // getting a window update
int64_t mServerReceiveWindow;
// LocalUnacked is the number of bytes received by the client but not // yet reflected in a window update. Sending that update will increment // ClientReceiveWindow
uint64_t mLocalUnacked{0};
// True when sending is suspended becuase the server receive window is // <= 0 bool mBlockedOnRwin{false};
// For Progress Events
uint64_t mTotalSent{0};
uint64_t mTotalRead{0};
// Used to store stream data when the transaction channel cannot keep up // and flow control has not yet kicked in.
SimpleBuffer mSimpleBuffer;
bool mAttempting0RTT{false};
};
} // namespace mozilla::net
#endif// mozilla_net_Http2StreamBase_h
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.