Skip to content

Commit 8d5a71f

Browse files
authored
Fix crash in HttpSM::tunnel_handler on unhandled VC events (#12959)
tunnel_handler is set as the VC read/write handler for the server connection after response header parsing, but it only asserts for HTTP_TUNNEL_EVENT_DONE and VC_EVENT_INACTIVITY_TIMEOUT. If a VC_EVENT_ACTIVE_TIMEOUT, VC_EVENT_ERROR, or VC_EVENT_EOS arrives on the server connection, the assertion fires and aborts the process. Widen the assertion to accept these events. The handler already sets terminate_sm = true for all events, so the behavior is correct — only the assertion was too narrow. Fixes #12958
1 parent 33566ff commit 8d5a71f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/proxy/http/HttpSM.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3136,7 +3136,8 @@ HttpSM::tunnel_handler(int event, void * /* data ATS_UNUSED */)
31363136
return 0;
31373137
}
31383138

3139-
ink_assert(event == HTTP_TUNNEL_EVENT_DONE || event == VC_EVENT_INACTIVITY_TIMEOUT);
3139+
ink_assert(event == HTTP_TUNNEL_EVENT_DONE || event == VC_EVENT_INACTIVITY_TIMEOUT || event == VC_EVENT_ACTIVE_TIMEOUT ||
3140+
event == VC_EVENT_ERROR || event == VC_EVENT_EOS);
31403141
// The tunnel calls this when it is done
31413142
terminate_sm = true;
31423143

0 commit comments

Comments
 (0)