Potential http parser defect due to case fallthrough?
schnoberts1 opened this issue · comments
Hi,
While removing a lot of warnings from ArduinoCore-mbed I noticed this code in http_parser.c:
switch (settings->on_headers_complete(parser)) {
case 0:
break;
case 2:
parser->upgrade = 1;
case 1:
parser->flags |= F_SKIPBODY;
break;
default:
SET_ERRNO(HPE_CB_headers_complete);
RETURN(p - data); /* Error */
}
case 2 falls through but unlike elsewhere in the codebase, it is not marked fall through so perhaps this is a defect? I'm not familiar with this code so I have no opinion, just thought I'd raise it.
not an expert too, but in other repos is marked as fallthrough, so it should be ok!
https://github.com/nodejs/http-parser/blob/ec8b5ee63f0e51191ea43bb0c6eac7bfbff3141d/http_parser.c#L1856