comparison src/http/modules/ngx_http_grpc_module.c @ 7977:336084ff943b

Moved Huffman coding out of HTTP/2. ngx_http_v2_huff_decode.c and ngx_http_v2_huff_encode.c are renamed to ngx_http_huff_decode.c and ngx_http_huff_encode.c.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 21 Dec 2021 07:54:16 +0300
parents 419c066cb710
children 2bf7792c262e
comparison
equal deleted inserted replaced
7976:76aea0ad78e5 7977:336084ff943b
3178 3178
3179 size = ngx_min(last - p, (ssize_t) ctx->field_rest); 3179 size = ngx_min(last - p, (ssize_t) ctx->field_rest);
3180 ctx->field_rest -= size; 3180 ctx->field_rest -= size;
3181 3181
3182 if (ctx->field_huffman) { 3182 if (ctx->field_huffman) {
3183 if (ngx_http_v2_huff_decode(&ctx->field_state, p, size, 3183 if (ngx_http_huff_decode(&ctx->field_state, p, size,
3184 &ctx->field_end, 3184 &ctx->field_end,
3185 ctx->field_rest == 0, 3185 ctx->field_rest == 0,
3186 r->connection->log) 3186 r->connection->log)
3187 != NGX_OK) 3187 != NGX_OK)
3188 { 3188 {
3189 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 3189 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
3190 "upstream sent invalid encoded header"); 3190 "upstream sent invalid encoded header");
3191 return NGX_ERROR; 3191 return NGX_ERROR;
3287 3287
3288 size = ngx_min(last - p, (ssize_t) ctx->field_rest); 3288 size = ngx_min(last - p, (ssize_t) ctx->field_rest);
3289 ctx->field_rest -= size; 3289 ctx->field_rest -= size;
3290 3290
3291 if (ctx->field_huffman) { 3291 if (ctx->field_huffman) {
3292 if (ngx_http_v2_huff_decode(&ctx->field_state, p, size, 3292 if (ngx_http_huff_decode(&ctx->field_state, p, size,
3293 &ctx->field_end, 3293 &ctx->field_end,
3294 ctx->field_rest == 0, 3294 ctx->field_rest == 0,
3295 r->connection->log) 3295 r->connection->log)
3296 != NGX_OK) 3296 != NGX_OK)
3297 { 3297 {
3298 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 3298 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
3299 "upstream sent invalid encoded header"); 3299 "upstream sent invalid encoded header");
3300 return NGX_ERROR; 3300 return NGX_ERROR;