Early return after :method is seen

This commit is contained in:
Tatsuhiro Tsujikawa 2015-02-20 19:26:34 +09:00
parent f755ea3894
commit 3dbd2d31bd
1 changed files with 12 additions and 10 deletions

View File

@ -494,10 +494,12 @@ void nghttp2_http_record_request_method(nghttp2_stream *stream,
return; return;
} }
/* TODO we should do this in stricter manner. */ /* TODO we should do this strictly. */
for (i = 0; i < nvlen; ++i) { for (i = 0; i < nvlen; ++i) {
const nghttp2_nv *nv = &nva[i]; const nghttp2_nv *nv = &nva[i];
if (lookup_token(nv->name, nv->namelen) == NGHTTP2_TOKEN__METHOD) { if (lookup_token(nv->name, nv->namelen) != NGHTTP2_TOKEN__METHOD) {
continue;
}
if (streq("CONNECT", nv->value, nv->valuelen)) { if (streq("CONNECT", nv->value, nv->valuelen)) {
stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_CONNECT; stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_CONNECT;
return; return;
@ -506,6 +508,6 @@ void nghttp2_http_record_request_method(nghttp2_stream *stream,
stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_HEAD; stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_HEAD;
return; return;
} }
} return;
} }
} }