aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_grpc_module.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2021-06-17 11:44:06 +0300
committerSergey Kandaurov <pluknet@nginx.com>2021-06-17 11:44:06 +0300
commit693e4134a51b4fd30689ad1e31e6fdffe5ee1429 (patch)
treef483272e19ea34019b4faa577dddc62ac891381f /src/http/modules/ngx_http_grpc_module.c
parentdcdf7ec096f0998e689b7f0b0f7541e197eeff6a (diff)
downloadnginx-693e4134a51b4fd30689ad1e31e6fdffe5ee1429.tar.gz
nginx-693e4134a51b4fd30689ad1e31e6fdffe5ee1429.zip
gRPC: RST_STREAM(NO_ERROR) handling micro-optimization.
After 2096b21fcd10, a single RST_STREAM(NO_ERROR) may not result in an error. This change removes several unnecessary ctx->type checks for such a case.
Diffstat (limited to 'src/http/modules/ngx_http_grpc_module.c')
-rw-r--r--src/http/modules/ngx_http_grpc_module.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_grpc_module.c b/src/http/modules/ngx_http_grpc_module.c
index 42a540f19..654bd17b9 100644
--- a/src/http/modules/ngx_http_grpc_module.c
+++ b/src/http/modules/ngx_http_grpc_module.c
@@ -2177,6 +2177,8 @@ ngx_http_grpc_filter(void *data, ssize_t bytes)
}
ctx->rst = 1;
+
+ continue;
}
if (ctx->type == NGX_HTTP_V2_GOAWAY_FRAME) {
@@ -3484,6 +3486,8 @@ ngx_http_grpc_parse_rst_stream(ngx_http_request_t *r, ngx_http_grpc_ctx_t *ctx,
return NGX_AGAIN;
}
+ ctx->state = ngx_http_grpc_st_start;
+
return NGX_OK;
}