Skip to content
Browse files

TS-1708: Using tr-pass port option causes requests with large headers…

… to hang

If 4KB of headers are read and we haven't decided on requets validity yet, disregard
tr-pass option in order to avoid blocking the writer
  • Loading branch information...
1 parent f41323e commit ec019615ff15894e01b91ea7b593a76534883b3b Uri Shachar committed
Showing with 12 additions and 2 deletions.
  1. +2 −0 CHANGES
  2. +10 −2 proxy/http/HttpSM.cc
View
2 CHANGES
@@ -2,6 +2,8 @@
Changes with Apache Traffic Server 3.3.2
+ *) [TS-1708] Using tr-pass port option causes requests with large headers to hang
+
*) [TS-1734] Remove dead code that invokes missing vmap_config tool
Author: John Kew <john.v.kew.ii@gmail.com>
View
12 proxy/http/HttpSM.cc
@@ -728,9 +728,9 @@ HttpSM::state_read_client_request_header(int event, void *data)
if (event == VC_EVENT_READ_READY &&
state == PARSE_ERROR &&
- is_transparent_passthrough_allowed()) {
+ is_transparent_passthrough_allowed() &&
+ ua_raw_buffer_reader != NULL) {
- ink_assert(ua_raw_buffer_reader != NULL);
DebugSM("http", "[%" PRId64 "] first request on connection failed parsing, switching to passthrough.", sm_id);
t_state.transparent_passthrough = true;
@@ -773,6 +773,14 @@ HttpSM::state_read_client_request_header(int event, void *data)
call_transact_and_set_next_state(HttpTransact::BadRequest);
break;
} else {
+ if (is_transparent_passthrough_allowed() &&
+ ua_raw_buffer_reader != NULL &&
+ ua_raw_buffer_reader->get_current_block()->write_avail() <= 0) {
+ //Disable passthrough regardless of eventual parsing failure or success -- otherwise
+ //we either have to consume some data or risk blocking the writer.
+ ua_raw_buffer_reader->dealloc();
+ ua_raw_buffer_reader = NULL;
+ }
ua_entry->read_vio->reenable();
return VC_EVENT_CONT;
}

0 comments on commit ec01961

Please sign in to comment.
Something went wrong with that request. Please try again.