]> git.ipfire.org Git - thirdparty/squid.git/commit
Better helper-to-Squid buffer size management.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 28 Feb 2012 23:45:23 +0000 (16:45 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 28 Feb 2012 23:45:23 +0000 (16:45 -0700)
commite7582642b2be843a2ea1e1bee41b7ea9f7c83dae
treed2aa99287252ef6217307e03116dee15db7e65e4
parent04bcb99b79482a0981dd22808e6ede0109dbd789
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