Mar 26th 2023 Dev

This commit is contained in:
Ned Wright 2023-03-27 15:07:44 +00:00
parent ea460d7949
commit 3c575fe73b

View File

@ -152,7 +152,7 @@ ngx_http_cp_hold_verdict(struct ngx_http_cp_event_thread_ctx_t *ctx)
for (uint i = 0; i < 3; i++) { for (uint i = 0; i < 3; i++) {
sleep(1); sleep(1);
int res = ngx_cp_run_in_thread_timeout( int res = ngx_cp_run_in_thread_timeout(
ngx_http_cp_hold_verdict_thread, ngx_http_cp_hold_verdict_thread,
(void *)ctx, (void *)ctx,
waiting_for_verdict_thread_timeout_msec, waiting_for_verdict_thread_timeout_msec,
"ngx_http_cp_hold_verdict_thread" "ngx_http_cp_hold_verdict_thread"
@ -166,7 +166,7 @@ ngx_http_cp_hold_verdict(struct ngx_http_cp_event_thread_ctx_t *ctx)
); );
continue; continue;
} }
if (session_data_p->verdict != TRAFFIC_VERDICT_WAIT) { if (session_data_p->verdict != TRAFFIC_VERDICT_WAIT) {
// Verdict was updated. // Verdict was updated.
write_dbg( write_dbg(
@ -550,12 +550,15 @@ ngx_http_cp_req_body_filter(ngx_http_request_t *request, ngx_chain_t *request_bo
req_body_thread_timeout_msec, req_body_thread_timeout_msec,
"ngx_http_cp_req_body_filter_thread" "ngx_http_cp_req_body_filter_thread"
); );
if (!res) { if (!res || ctx.res == NGX_ERROR) {
// failed to execute thread task, or it timed out // failed to execute thread task, or it timed out
session_data_p->verdict = fail_mode_verdict == NGX_OK ? TRAFFIC_VERDICT_ACCEPT : TRAFFIC_VERDICT_DROP; session_data_p->verdict = fail_mode_verdict == NGX_OK ? TRAFFIC_VERDICT_ACCEPT : TRAFFIC_VERDICT_DROP;
write_dbg( write_dbg(
DBG_LEVEL_DEBUG, DBG_LEVEL_DEBUG,
"req_body_filter thread failed, returning default fail mode verdict. Session id: %d, verdict: %s", "req_body_filter thread failed, returning default fail mode verdict. "
"thread execution result: %d, nano service reply: %d, Session id: %d, verdict: %s",
res,
ctx.res,
session_data_p->session_id, session_data_p->session_id,
session_data_p->verdict == TRAFFIC_VERDICT_ACCEPT ? "accept" : "drop" session_data_p->verdict == TRAFFIC_VERDICT_ACCEPT ? "accept" : "drop"
); );