Skip to content

Commit

Permalink
fix comment, active on connect
Browse files Browse the repository at this point in the history
Signed-off-by: ohadvano <[email protected]>
  • Loading branch information
ohadvano committed Feb 27, 2024
1 parent 1f6e6b4 commit 673ea0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions envoy/tcp/async_tcp_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ class AsyncTcpClient {

/**
* Connect to a remote host. Errors or connection events are reported via the
* event callback registered via setAsyncTcpClientCallbacks(). We need to set the
* callbacks again to call connect() after the connection is disconnected.
* event callback registered via setAsyncTcpClientCallbacks(). If the callbacks
* needs to be changed before reconnecting, it is required to set the callbacks
* again, before calling to connect() to attempting to reconnect.
* @returns true if a new client has created and the connection is in progress.
* @returns false if an underlying client exists and is connected or connecting.
*/
Expand Down
3 changes: 1 addition & 2 deletions source/common/tcp/async_tcp_client_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ bool AsyncTcpClientImpl::connect() {
}

cluster_info_->trafficStats()->upstream_cx_total_.inc();
cluster_info_->trafficStats()->upstream_cx_active_.inc();
connection_->enableHalfClose(enable_half_close_);
connection_->addConnectionCallbacks(*this);
connection_->addReadFilter(std::make_shared<NetworkReadFilter>(*this));
Expand Down Expand Up @@ -132,8 +133,6 @@ void AsyncTcpClientImpl::onEvent(Network::ConnectionEvent event) {
callbacks_->onEvent(event);
}
} else {
cluster_info_->trafficStats()->upstream_cx_active_.inc();

connected_ = true;
conn_connect_ms_->complete();
conn_connect_ms_.reset();
Expand Down

0 comments on commit 673ea0e

Please sign in to comment.