Skip to content

Commit

Permalink
Modify to implement new half-close interfaces. (envoyproxy#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Greg Greenway <[email protected]>
  • Loading branch information
ggreenway authored and htuch committed Feb 2, 2018
1 parent ab03265 commit 39dc2dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions echo2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
namespace Envoy {
namespace Filter {

Network::FilterStatus Echo2::onData(Buffer::Instance& data) {
Network::FilterStatus Echo2::onData(Buffer::Instance& data, bool) {
ENVOY_CONN_LOG(trace, "echo: got {} bytes", read_callbacks_->connection(), data.length());
read_callbacks_->connection().write(data);
read_callbacks_->connection().write(data, false);
ASSERT(0 == data.length());
return Network::FilterStatus::StopIteration;
}

} // Filter
} // Envoy
} // namespace Filter
} // namespace Envoy
6 changes: 3 additions & 3 deletions echo2.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Filter {
class Echo2 : public Network::ReadFilter, Logger::Loggable<Logger::Id::filter> {
public:
// Network::ReadFilter
Network::FilterStatus onData(Buffer::Instance& data) override;
Network::FilterStatus onData(Buffer::Instance& data, bool end_stream) override;
Network::FilterStatus onNewConnection() override { return Network::FilterStatus::Continue; }
void initializeReadFilterCallbacks(Network::ReadFilterCallbacks& callbacks) override {
read_callbacks_ = &callbacks;
Expand All @@ -23,5 +23,5 @@ class Echo2 : public Network::ReadFilter, Logger::Loggable<Logger::Id::filter> {
Network::ReadFilterCallbacks* read_callbacks_{};
};

} // Filter
} // Envoy
} // namespace Filter
} // namespace Envoy

0 comments on commit 39dc2dd

Please sign in to comment.