Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Beyad <abeyad@google.com>
  • Loading branch information
abeyad committed Aug 19, 2024
1 parent 9fc7c01 commit bdb9a1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions contrib/vcl/source/vcl_io_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ Api::IoCallUint64Result VclIoHandle::close() {

bool VclIoHandle::isOpen() const { return VCL_SH_VALID(sh_); }

bool VclIoHandle::isConnected() const { return false; }

Api::IoCallUint64Result VclIoHandle::readv(uint64_t max_length, Buffer::RawSlice* slices,
uint64_t num_slice) {
if (!VCL_SH_VALID(sh_)) {
Expand Down
1 change: 1 addition & 0 deletions contrib/vcl/source/vcl_io_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class VclIoHandle : public Envoy::Network::IoHandle,
os_fd_t fdDoNotUse() const override { return fd_; }
Api::IoCallUint64Result close() override;
bool isOpen() const override;
bool isConnected() const override;
Api::IoCallUint64Result readv(uint64_t max_length, Buffer::RawSlice* slices,
uint64_t num_slice) override;
Api::IoCallUint64Result read(Buffer::Instance& buffer,
Expand Down
6 changes: 4 additions & 2 deletions source/common/quic/envoy_quic_client_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ void EnvoyQuicClientConnection::setUpConnectionSocket(Network::ConnectionSocket&
ENVOY_CONN_LOG(error, "Fail to apply listening options", *this);
connection_socket.close();
}
}
if (!connection_socket.isOpen()) {
} else if (connectionSocket().get() == &connection_socket) {
// Only close the connection if the connection socket is the current one. If it is a probing
// socket that isn't the current socket, do not close the connection upon failure, as the
// current socket is still valid.
CloseConnection(quic::QUIC_CONNECTION_CANCELLED, "Fail to set up connection socket.",
quic::ConnectionCloseBehavior::SILENT_CLOSE);
}
Expand Down

0 comments on commit bdb9a1a

Please sign in to comment.