Merge pull request #1745 from nghttp2/no-lws-check

No need to check pseudo header lws
This commit is contained in:
Tatsuhiro Tsujikawa 2022-06-25 11:52:15 +09:00 committed by GitHub
commit e065cbccb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 14 deletions

View File

@ -73,22 +73,9 @@ static int64_t parse_uint(const uint8_t *s, size_t len) {
return n; return n;
} }
static int lws(const uint8_t *s, size_t n) {
size_t i;
for (i = 0; i < n; ++i) {
if (s[i] != ' ' && s[i] != '\t') {
return 0;
}
}
return 1;
}
static int check_pseudo_header(nghttp2_stream *stream, const nghttp2_hd_nv *nv, static int check_pseudo_header(nghttp2_stream *stream, const nghttp2_hd_nv *nv,
uint32_t flag) { uint32_t flag) {
if (stream->http_flags & flag) { if ((stream->http_flags & flag) || nv->value->len == 0) {
return 0;
}
if (lws(nv->value->base, nv->value->len)) {
return 0; return 0;
} }
stream->http_flags = stream->http_flags | flag; stream->http_flags = stream->http_flags | flag;