mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-02-26 19:52:06 +01:00
CLEANUP: mworker/cli: use a label to return errors
Remove the returns in the function to end directly at the end label.
This commit is contained in:
parent
e3557c7d45
commit
dd38c37777
@ -2605,13 +2605,15 @@ int pcli_parse_request(struct stream *s, struct channel *req, char **errmsg, int
|
||||
|
||||
/* there is no end to this command, need more to parse ! */
|
||||
if (!reql || *(end-1) != '\n') {
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (s->pcli_flags & PCLI_F_PAYLOAD) {
|
||||
if (reql == 1) /* last line of the payload */
|
||||
s->pcli_flags &= ~PCLI_F_PAYLOAD;
|
||||
return reql;
|
||||
ret = reql;
|
||||
goto end;
|
||||
}
|
||||
|
||||
*(end-1) = '\0';
|
||||
@ -2674,7 +2676,8 @@ int pcli_parse_request(struct stream *s, struct channel *req, char **errmsg, int
|
||||
ret = end - trim;
|
||||
} else if (wtrim < 0) {
|
||||
/* parsing error */
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto end;
|
||||
} else {
|
||||
/* the whole string */
|
||||
ret = end - str;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user