]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: log-format: make the format parser more robust and more extensible
authorWilly Tarreau <w@1wt.eu>
Thu, 20 Dec 2012 20:23:42 +0000 (21:23 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Dec 2012 22:34:20 +0000 (23:34 +0100)
commit8a3f52fc2e60f6c274af0f781d54d0d9b91e349c
tree7c2d16443a9c3df654c4d161b0f5807ac43440cf
parenta3571668896a600c3ffc1427201abd03d80e6b49
MEDIUM: log-format: make the format parser more robust and more extensible

The log-format parser reached a limit making it hard to add new features.
It also suffers from a weak handling of certain incorrect corner cases,
for example "%{foo}" is emitted as a litteral while syntactically it's an
argument to no variable. Also the argument parser had to redo some of the
job with some cases causing minor memory leaks (eg: ignored args).

This work aims at improving the situation so that slightly better reporting
is possible and that it becomes possible to extend the log format. The code
has a few more states but looks significantly simpler. The parser is now
capable of reporting ignored arguments and truncated lines.
include/proto/log.h
include/types/log.h
src/log.c