comparison src/http/v2/ngx_http_v2.c @ 6955:d38161da62cd

HTTP/2: emit PROTOCOL_ERROR on padding errors. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
author Piotr Sikora <piotrsikora@google.com>
date Sun, 26 Mar 2017 01:25:05 -0700
parents 052305810ca4
children 9b5f31fdb850
comparison
equal deleted inserted replaced
6954:052305810ca4 6955:d38161da62cd
810 ngx_log_error(NGX_LOG_INFO, h2c->connection->log, 0, 810 ngx_log_error(NGX_LOG_INFO, h2c->connection->log, 0,
811 "client sent padded DATA frame " 811 "client sent padded DATA frame "
812 "with incorrect length: %uz, padding: %uz", 812 "with incorrect length: %uz, padding: %uz",
813 size, h2c->state.padding); 813 size, h2c->state.padding);
814 814
815 return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR); 815 return ngx_http_v2_connection_error(h2c,
816 NGX_HTTP_V2_PROTOCOL_ERROR);
816 } 817 }
817 818
818 h2c->state.length -= 1 + h2c->state.padding; 819 h2c->state.length -= 1 + h2c->state.padding;
819 } 820 }
820 821
1053 ngx_log_error(NGX_LOG_INFO, h2c->connection->log, 0, 1054 ngx_log_error(NGX_LOG_INFO, h2c->connection->log, 0,
1054 "client sent padded HEADERS frame " 1055 "client sent padded HEADERS frame "
1055 "with incorrect length: %uz, padding: %uz", 1056 "with incorrect length: %uz, padding: %uz",
1056 h2c->state.length, h2c->state.padding); 1057 h2c->state.length, h2c->state.padding);
1057 1058
1058 return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR); 1059 return ngx_http_v2_connection_error(h2c,
1060 NGX_HTTP_V2_PROTOCOL_ERROR);
1059 } 1061 }
1060 1062
1061 h2c->state.length -= h2c->state.padding; 1063 h2c->state.length -= h2c->state.padding;
1062 } 1064 }
1063 1065