Add DEBUG_PROXY around debug func params

pull/48/head
Soner Tari 3 years ago
parent f056f699c1
commit dff3f90c62

@ -503,7 +503,11 @@ protohttp_filter(pxy_conn_ctx_t *ctx, filter_list_t *list)
}
if (action_host || action_uri)
return pxyconn_set_filter_action(ctx, action_host, action_uri, http_ctx->http_host, http_ctx->http_uri);
return pxyconn_set_filter_action(ctx, action_host, action_uri
#ifdef DEBUG_PROXY
, http_ctx->http_host, http_ctx->http_uri
#endif /* DEBUG_PROXY */
);
return FILTER_ACTION_NONE;
}

@ -740,7 +740,11 @@ protossl_filter(pxy_conn_ctx_t *ctx, filter_list_t *list)
}
if (action_sni || action_cn)
return pxyconn_set_filter_action(ctx, action_sni, action_cn, ctx->sslctx->sni, ctx->sslctx->ssl_names);
return pxyconn_set_filter_action(ctx, action_sni, action_cn
#ifdef DEBUG_PROXY
, ctx->sslctx->sni, ctx->sslctx->ssl_names
#endif /* DEBUG_PROXY */
);
return FILTER_ACTION_NONE;
}

@ -546,7 +546,11 @@ prototcp_dsthost_filter(pxy_conn_ctx_t *ctx, filter_list_t *list)
if (ctx->dsthost_str) {
filter_action_t *action;
if ((action = prototcp_filter_match_ip(ctx, list)))
return pxyconn_set_filter_action(ctx, action, NULL, ctx->dsthost_str, NULL);
return pxyconn_set_filter_action(ctx, action, NULL
#ifdef DEBUG_PROXY
, ctx->dsthost_str, NULL
#endif /* DEBUG_PROXY */
);
log_finest_va("No filter match with ip: %s:%s, %s:%s",
STRORDASH(ctx->srchost_str), STRORDASH(ctx->srcport_str), STRORDASH(ctx->dsthost_str), STRORDASH(ctx->dstport_str));

@ -2007,22 +2007,30 @@ pxyconn_apply_deferred_block_action(pxy_conn_ctx_t *ctx)
}
unsigned int
pxyconn_set_filter_action(pxy_conn_ctx_t *ctx, filter_action_t *a1, filter_action_t *a2, UNUSED char *s1, UNUSED char *s2)
pxyconn_set_filter_action(pxy_conn_ctx_t *ctx, filter_action_t *a1, filter_action_t *a2
#ifdef DEBUG_PROXY
, char *s1, char *s2
#endif /* DEBUG_PROXY */
)
{
filter_action_t *a;
#ifdef DEBUG_PROXY
char *site;
#endif /* DEBUG_PROXY */
// a1 has precedence over a2, unless a2's precedence is higher
if (!a1 || (a1 && a2 && (a1->precedence < a2->precedence))) {
a = a2;
site = s2;
#ifdef DEBUG_PROXY
site = s2;
if (a1 && a2 && (a1->precedence < a2->precedence))
log_finest_va("Rule 2 has higher precedence than rule 1: %d > %d, %s, %s", a2->precedence, a1->precedence, s2, s1);
#endif /* DEBUG_PROXY */
} else {
a = a1;
#ifdef DEBUG_PROXY
site = s1;
#endif /* DEBUG_PROXY */
}
unsigned int action = FILTER_ACTION_NONE;

@ -446,7 +446,11 @@ 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_block_action(pxy_conn_ctx_t *) NONNULL(1) WUNRES;
unsigned int pxyconn_set_filter_action(pxy_conn_ctx_t *, filter_action_t *, filter_action_t *, UNUSED char *, UNUSED char *) NONNULL(1) WUNRES;
unsigned int pxyconn_set_filter_action(pxy_conn_ctx_t *, filter_action_t *, filter_action_t *
#ifdef DEBUG_PROXY
, char *, char *
#endif /* DEBUG_PROXY */
) NONNULL(1) WUNRES;
filter_action_t *pxyconn_filter_port(pxy_conn_ctx_t *, filter_site_t *) NONNULL(1,2);
unsigned int pxyconn_filter(pxy_conn_ctx_t *, proto_filter_func_t) NONNULL(1) WUNRES;
void pxy_conn_setup(evutil_socket_t, struct sockaddr *, int,

Loading…
Cancel
Save