]> git.ipfire.org Git - thirdparty/squid.git/commit
squidclient: Improve shell-escape support in -H option
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 20 May 2016 05:25:58 +0000 (17:25 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 20 May 2016 05:25:58 +0000 (17:25 +1200)
commit8798e209833f31da6f3f411e8d3cae4c879c478d
tree8aec854aa98b71f0cd483ca4c4c7771cab8cfc33
parente235dd5932cec3d7049da6b941c52cd52768ab55
squidclient: Improve shell-escape support in -H option

The -H parameter takes a string with some limited shell-escaped
characters. Currently just \n was expanded to the CRLF sequence.
Other shell escaped characters were left untouched.

However, to properly test headers containing weird CR, LF and HTAB
positioning it needs to be able to receive these special characters
individually and thus unescape them.

Add a new function similar to perform shell unescape with special
characters \\, \r, \n, and \t. All other characters are un-escaped
to themselves and a warning printed at verbosity level 1.
tools/squidclient/squidclient.cc