Skip to content

Commit 0fd5e19

Browse files
committed
update for subrequest microservice, nginx link function will ignore the response status & content, but it's keeping the headers content to communicate the service per request based
headers will merge by request and subrequest
1 parent a72df58 commit 0fd5e19

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/ngx_link_func_module.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,19 +1075,23 @@ ngx_http_link_func_after_process(ngx_event_t *ev) {
10751075
static ngx_int_t
10761076
ngx_http_link_func_subreqest_parallel_done(ngx_http_request_t *r, void *data, ngx_int_t rc) {
10771077
ngx_http_link_func_internal_ctx_t *ctx = data;
1078+
ngx_uint_t status = r->headers_out.status;
1079+
10781080
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1079-
"subrequest parallel done:%ui", r->headers_out.status);
1080-
if (ctx->subreq_parallel_wait_cnt) {
1081+
"subrequest parallel done:%ui", status);
1082+
if (status) {
10811083
ctx->subreq_parallel_wait_cnt--;
10821084
}
10831085
return rc;
10841086
}
10851087
static ngx_int_t
10861088
ngx_http_link_func_subreqest_sequential_done(ngx_http_request_t *r, void *data, ngx_int_t rc) {
10871089
ngx_http_link_func_internal_ctx_t *ctx = data;
1090+
ngx_uint_t status = r->headers_out.status;
1091+
10881092
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1089-
"subrequest sequential done:%ui", r->headers_out.status);
1090-
if (ctx->subreq_sequential_wait_cnt) {
1093+
"subrequest sequential done:%ui", status);
1094+
if (status) {
10911095
ctx->subreq_sequential_wait_cnt--;
10921096
}
10931097
return rc;

0 commit comments

Comments
 (0)