Fix deferred pass filter action in SSL filter

Do not call protopassthrough_engage() twice. If we call it to apply the
deferred pass action and also set the ctx->pass flag, it will be called
again in protossl_setup_src_ssl(). So, just set the flag and leave the
rest to protossl_setup_src_ssl().
pull/48/head
Soner Tari 3 years ago
parent db9974617f
commit 39e1d87783

@ -812,8 +812,12 @@ protossl_apply_filter(pxy_conn_ctx_t *ctx)
// Cannot defer pass action any longer
// Match action should not override pass action, hence no 'else if'
if (pxyconn_apply_deferred_pass_action(ctx))
if (ctx->deferred_action & FILTER_ACTION_PASS) {
log_fine("Applying deferred pass action");
ctx->deferred_action = FILTER_ACTION_NONE;
ctx->pass = 1;
rv = 1;
}
return rv;
}

@ -1995,19 +1995,6 @@ pxy_userauth(pxy_conn_ctx_t *ctx)
}
#endif /* !WITHOUT_USERAUTH */
int
pxyconn_apply_deferred_pass_action(pxy_conn_ctx_t *ctx)
{
if (ctx->deferred_action & FILTER_ACTION_PASS) {
log_fine("Applying deferred pass action");
ctx->deferred_action = FILTER_ACTION_NONE;
protopassthrough_engage(ctx);
ctx->pass = 1;
return 1;
}
return 0;
}
int
pxyconn_apply_deferred_block_action(pxy_conn_ctx_t *ctx)
{

@ -444,7 +444,6 @@ int pxy_is_listuser(userlist_t *, const char *
void pxy_classify_user(pxy_conn_ctx_t *) NONNULL(1);
void pxy_userauth(pxy_conn_ctx_t *) NONNULL(1);
#endif /* !WITHOUT_USERAUTH */
int pxyconn_apply_deferred_pass_action(pxy_conn_ctx_t *) NONNULL(1);
int pxyconn_apply_deferred_block_action(pxy_conn_ctx_t *) NONNULL(1);
unsigned int pxyconn_set_filter_action(pxy_conn_ctx_t *, filter_site_t *) NONNULL(1,2);
unsigned int pxyconn_filter(pxy_conn_ctx_t *, proto_filter_func_t) NONNULL(1);

Loading…
Cancel
Save