proxygen
HTTPParallelCodec.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
11 
12 #include <algorithm>
13 #include <boost/algorithm/string.hpp>
14 #include <folly/Conv.h>
15 #include <folly/String.h>
16 #include <folly/io/Cursor.h>
17 #include <glog/logging.h>
20 
21 namespace proxygen {
22 
24  : transportDirection_(direction),
25  sessionClosing_(ClosingState::OPEN) {
26  switch (transportDirection_) {
29  break;
32  break;
33  default:
34  LOG(FATAL) << "Unknown transport direction.";
35  }
36 }
37 
39  auto ret = nextEgressStreamID_;
41  return ret;
42 }
43 
45  return sessionClosing_ == ClosingState::OPEN ||
46  sessionClosing_ == ClosingState::FIRST_GOAWAY_SENT;
47 }
48 
50  return (sessionClosing_ == ClosingState::OPEN ||
51  sessionClosing_ == ClosingState::OPEN_WITH_GRACEFUL_DRAIN_ENABLED ||
56 }
57 
59  CHECK_EQ(sessionClosing_, ClosingState::OPEN);
60  sessionClosing_ = ClosingState::OPEN_WITH_GRACEFUL_DRAIN_ENABLED;
61 }
62 
65  lastStreamID_ = 1;
66  }
67  return true;
68 }
69 
70 }
bool onIngressUpgradeMessage(const HTTPMessage &msg) override
LogLevel max
Definition: LogLevel.cpp:31
bool isReusable() const override
enum proxygen::HTTPParallelCodec::ClosingState sessionClosing_
StreamID createStream() override
void enableDoubleGoawayDrain() override
bool isWaitingToDrain() const override
uint64_t StreamID
Definition: HTTPCodec.h:49
HTTPParallelCodec(TransportDirection direction)
TransportDirection transportDirection_