mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-29 01:31:19 +02:00
[MINOR] stats: strip CR and LF from the input command line
commands sent from certain tools (eg: telnet) will be terminated by CRLF and not only LF. So we must suppress CR too.
This commit is contained in:
parent
33b230b34a
commit
816fc22a4a
@ -363,13 +363,19 @@ void stats_io_handler(struct stream_interface *si)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ensure we have a full line */
|
/* now it is time to check that we have a full line,
|
||||||
if (trash[reql-1] != '\n') {
|
* remove the trailing \n and possibly \r, then cut the
|
||||||
|
* line.
|
||||||
|
*/
|
||||||
|
len = reql - 1;
|
||||||
|
if (trash[len] != '\n') {
|
||||||
s->ana_state = STATS_ST_CLOSE;
|
s->ana_state = STATS_ST_CLOSE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = reql - 1;
|
if (len && trash[len-1] == '\r')
|
||||||
|
len--;
|
||||||
|
|
||||||
trash[len] = '\0';
|
trash[len] = '\0';
|
||||||
|
|
||||||
si->st0 = 1; // default to prompt
|
si->st0 = 1; // default to prompt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user