Klaus Demo nginx / 65a28d1
gRPC: limited allocations due to ping and settings frames. Maxim Dounin 2 years ago
1 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
7676 ngx_http_grpc_conn_t *connection;
7777
7878 ngx_uint_t id;
79
80 ngx_uint_t pings;
81 ngx_uint_t settings;
7982
8083 ssize_t send_window;
8184 size_t recv_window;
35303533 ctx->rest);
35313534 return NGX_ERROR;
35323535 }
3536
3537 if (ctx->free == NULL && ctx->settings++ > 1000) {
3538 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
3539 "upstream sent too many settings frames");
3540 return NGX_ERROR;
3541 }
35333542 }
35343543
35353544 for (p = b->pos; p < last; p++) {
36803689 if (ctx->flags & NGX_HTTP_V2_ACK_FLAG) {
36813690 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
36823691 "upstream sent ping frame with ack flag");
3692 return NGX_ERROR;
3693 }
3694
3695 if (ctx->free == NULL && ctx->pings++ > 1000) {
3696 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
3697 "upstream sent too many ping frames");
36833698 return NGX_ERROR;
36843699 }
36853700 }