HTTP parser: simplified nxt_http_parse_field_value().
There's no need in loop after 4ac474b68658. Found by Coverity (CID 259713).
This commit is contained in:
@@ -629,7 +629,6 @@ nxt_http_parse_field_value(nxt_http_request_parse_t *rp, u_char **pos,
|
|||||||
|
|
||||||
p += rp->field_value.length;
|
p += rp->field_value.length;
|
||||||
|
|
||||||
for ( ;; ) {
|
|
||||||
p = nxt_http_lookup_field_end(p, end);
|
p = nxt_http_lookup_field_end(p, end);
|
||||||
|
|
||||||
if (nxt_slow_path(p == end)) {
|
if (nxt_slow_path(p == end)) {
|
||||||
@@ -646,10 +645,7 @@ nxt_http_parse_field_value(nxt_http_request_parse_t *rp, u_char **pos,
|
|||||||
|
|
||||||
ch = *p;
|
ch = *p;
|
||||||
|
|
||||||
if (nxt_fast_path(ch == '\r' || ch == '\n')) {
|
if (nxt_slow_path(ch != '\r' && ch != '\n')) {
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NXT_HTTP_PARSE_INVALID;
|
return NXT_HTTP_PARSE_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user