]> git.ipfire.org Git - thirdparty/squid.git/commit
Better helper-to-Squid buffer size management.
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 7 Mar 2012 01:09:59 +0000 (18:09 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 7 Mar 2012 01:09:59 +0000 (18:09 -0700)
commit9555c92972f4e712c3fbf162496f9be1220dbeab
tree6698a2408e23007fc2463768f23cf1ea8262d798
parent95f7869a2e04db086da35bce490b3dab9bb730c7
Better helper-to-Squid buffer size management.

The minimum buffer size is reduced from 8KB to 4KB after a squid-dev
discussion to prevent wasting of "several hundred KB of unused permanent
memory on some installations".

We now increase the buffer if we cannot parse the helper response message.

The maximum buffer size is now 32KB. This should be enough for all known
helper responses.

We now warn if the read buffer reaches its capacity and kill the offending
helper explicitly. An increase in maximum buffer capacity to 32KB should make
such events rare.

Motivation: ssl_crtd helper may produce responses exceeding 9907 bytes in size
(and possibly much larger if multiple chained certificates need to be returned
to Squid). The old helper.cc code would fill the read buffer completely,
schedule a read for zero bytes, receive zero bytes, declare an EOF condition,
and close the stream (which kills ssl_crtd).  Due to insufficient information
logged, the observable symptoms were pretty much the same as if ssl_crtd
closed the stream first, indicating a ssl_crtd bug.
src/helper.cc