summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2020-11-24 17:19:40 +0000
committerSergey Kandaurov <pluknet@nginx.com>2020-11-24 17:19:40 +0000
commit5a9a897d7b632d6123aacabf1c0f141db0ad799b (patch)
treebbc25e7a291e8721d91cd11186627068eaab7cad /src/http/modules
parent219053e3e3bd18ecb195815df0023da40dbdff9d (diff)
parent84a2201964df4c255f7b605951a0ddbae124184f (diff)
downloadnginx-5a9a897d7b632d6123aacabf1c0f141db0ad799b.tar.gz
nginx-5a9a897d7b632d6123aacabf1c0f141db0ad799b.tar.bz2
Merged with the default branch.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_grpc_module.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/src/http/modules/ngx_http_grpc_module.c b/src/http/modules/ngx_http_grpc_module.c
index 7e14af8d9..aa7576561 100644
--- a/src/http/modules/ngx_http_grpc_module.c
+++ b/src/http/modules/ngx_http_grpc_module.c
@@ -1141,20 +1141,11 @@ ngx_http_grpc_create_request(ngx_http_request_t *r)
f->flags |= NGX_HTTP_V2_END_HEADERS_FLAG;
-#if (NGX_DEBUG)
- if (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP) {
- u_char buf[512];
- size_t n, m;
-
- n = ngx_min(b->last - b->pos, 256);
- m = ngx_hex_dump(buf, b->pos, n) - buf;
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "grpc header: %*s%s, len: %uz",
- m, buf, b->last - b->pos > 256 ? "..." : "",
- b->last - b->pos);
- }
-#endif
+ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "grpc header: %*xs%s, len: %uz",
+ (size_t) ngx_min(b->last - b->pos, 256), b->pos,
+ b->last - b->pos > 256 ? "..." : "",
+ b->last - b->pos);
if (r->request_body_no_buffering) {
@@ -1604,20 +1595,11 @@ ngx_http_grpc_process_header(ngx_http_request_t *r)
u = r->upstream;
b = &u->buffer;
-#if (NGX_DEBUG)
- if (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP) {
- u_char buf[512];
- size_t n, m;
-
- n = ngx_min(b->last - b->pos, 256);
- m = ngx_hex_dump(buf, b->pos, n) - buf;
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "grpc response: %*s%s, len: %uz",
- m, buf, b->last - b->pos > 256 ? "..." : "",
- b->last - b->pos);
- }
-#endif
+ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "grpc response: %*xs%s, len: %uz",
+ (size_t) ngx_min(b->last - b->pos, 256),
+ b->pos, b->last - b->pos > 256 ? "..." : "",
+ b->last - b->pos);
ctx = ngx_http_grpc_get_ctx(r);
@@ -1987,6 +1969,7 @@ ngx_http_grpc_filter_init(void *data)
}
u->length = 0;
+ ctx->done = 1;
} else {
u->length = 1;