Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Fix dead assignments in parser.c
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFrench committed Sep 9, 2017
1 parent 60b85ca commit e0a48e1
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,6 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len)
}
break;
case s_port:
res = 0;

if (ch >= '0' && ch <= '9') {
p->buf[p->buf_idx++] = ch;
p->buf[p->buf_idx] = '\0';
Expand Down Expand Up @@ -1607,7 +1605,6 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len)
break;
case s_hdrline_hdr_val:
err = 0;
res = 0;

do {
htparse_log_debug("[%p] s_hdrline_hdr_val", p);
Expand Down Expand Up @@ -1812,11 +1809,8 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len)
case s_hdrline_almost_done:
htparse_log_debug("[%p] s_hdrline_almost_done", p);

res = 0;

switch (ch) {
case LF:
res = 0;
res = hook_on_hdrs_complete_run(p, hooks);

if (res != 0) {
Expand All @@ -1825,7 +1819,6 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len)
}

p->buf_idx = 0;
htparse_log_debug("[%p] HERE", p);

if (p->flags & parser_flag_trailing) {
res = hook_on_msg_complete_run(p, hooks);
Expand Down Expand Up @@ -1866,7 +1859,6 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len)
if (p->flags & parser_flag_trailing) {
res = hook_on_msg_complete_run(p, hooks);
p->state = s_start;
break;
} else if (p->flags & parser_flag_chunked) {
p->state = s_chunk_size_start;
i--;
Expand All @@ -1877,6 +1869,7 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len)
res = hook_on_msg_complete_run(p, hooks);
p->state = s_start;
}

if (res) {
p->error = htparse_error_user;
return i + 1;
Expand Down Expand Up @@ -1912,8 +1905,6 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len)
break;

case s_chunk_size_almost_done:
res = 0;

if (ch != LF) {
p->error = htparse_error_inval_chunk_sz;
return i + 1;
Expand Down

0 comments on commit e0a48e1

Please sign in to comment.