Skip to content

Commit

Permalink
mitm - stop filtering if set dead by a filter
Browse files Browse the repository at this point in the history
 - shutdown
 - send webhook, because on_error may or may not be called
  • Loading branch information
astibal committed Nov 2, 2023
1 parent d2bb116 commit ba130b4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/proxy/mitmproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,15 @@ void MitmProxy::proxy(baseHostCX* from, baseHostCX* to, side_t side, bool redire

_deb("MitmProxy::proxy: running filter %s", filter_name.c_str());
filter_proxy->proxy(from, to, side, redirected);

if(state().dead()) {
_deb("MitmProxy::proxy: filter %s: proxy marked dead", filter_name.c_str());

// after marking dead, session is not getting on_error anymore
webhook_session_stop();
shutdown();
return;
}
}

auto sz = from->to_read().size();
Expand Down

0 comments on commit ba130b4

Please sign in to comment.