@@ -93,7 +93,7 @@ void Filter::onRead() {
93
93
if (read_state == ReadOrParseState::Error) {
94
94
config_->stats_ .downstream_cx_proxy_proto_error_ .inc ();
95
95
cb_->continueFilterChain (false );
96
- } else if (read_state == ReadOrParseState::SkipFilterError ) {
96
+ } else if (read_state == ReadOrParseState::SkipFilter ) {
97
97
resetAndContinue (cb_->socket ().ioHandle ());
98
98
}
99
99
}
@@ -320,7 +320,7 @@ ReadOrParseState Filter::parseExtensions(Network::IoHandle& io_handle, uint8_t*
320
320
const auto recv_result = io_handle.recv (buf, to_read, 0 );
321
321
if (!recv_result.ok ()) {
322
322
if (recv_result.err_ ->getErrorCode () == Api::IoError::IoErrorCode::Again) {
323
- return ReadOrParseState::TryAgainLaterError ;
323
+ return ReadOrParseState::TryAgainLater ;
324
324
}
325
325
ENVOY_LOG (debug, " failed to read proxy protocol (no bytes avail)" );
326
326
return ReadOrParseState::Error;
@@ -435,7 +435,7 @@ ReadOrParseState Filter::readProxyHeader(Network::IoHandle& io_handle) {
435
435
436
436
if (!result.ok ()) {
437
437
if (result.err_ ->getErrorCode () == Api::IoError::IoErrorCode::Again) {
438
- return ReadOrParseState::TryAgainLaterError ;
438
+ return ReadOrParseState::TryAgainLater ;
439
439
}
440
440
ENVOY_LOG (debug, " failed to read proxy protocol (no bytes read)" );
441
441
return ReadOrParseState::Error;
@@ -445,16 +445,15 @@ ReadOrParseState Filter::readProxyHeader(Network::IoHandle& io_handle) {
445
445
if (nread < 1 ) {
446
446
ENVOY_LOG (debug, " failed to read proxy protocol (no bytes read)" );
447
447
return ReadOrParseState::Error;
448
- } else if (nread < PROXY_PROTO_V2_HEADER_LEN &&
449
- config_.get ()->allowRequestsWithoutProxyProtocol ()) {
448
+ } else if (config_.get ()->allowRequestsWithoutProxyProtocol ()) {
450
449
if (memcmp (buf_, PROXY_PROTO_V1_SIGNATURE,
451
450
std::min<size_t >(buf_off_ + nread, PROXY_PROTO_V1_SIGNATURE_LEN)) &&
452
451
memcmp (buf_, PROXY_PROTO_V2_SIGNATURE,
453
452
std::min<size_t >(buf_off_ + nread, PROXY_PROTO_V2_SIGNATURE_LEN))) {
454
453
// the bytes we have seen so far do not match v1 or v2 proxy protocol, so we can safely
455
454
// short-circuit
456
455
ENVOY_LOG (debug, " request does not use v1 or v2 proxy protocol, forwarding as is" );
457
- return ReadOrParseState::SkipFilterError ;
456
+ return ReadOrParseState::SkipFilter ;
458
457
}
459
458
}
460
459
0 commit comments