[PATCH] Increase maximum length of http response buffer

David Woodhouse dwmw2 at infradead.org
Wed Feb 10 17:09:37 EST 2010


On Wed, 2010-02-10 at 23:02 +0100, Adam Piątyszek wrote:
> 
> It seems that my company upgraded the CSD trojan on their VPN
> gateways,
> becasue I got the following error message from openconnect:
> 
>   Response body too large for buffer (141075 > 131072)
> 
> This patch fixes the problem for me, so please consider applying it
> onto your master branch. 

Hm, the ideal reaction to such problems is not just to increase the
limit, but to remove it by doing some kind of realloc()...

With HTTP chunked encoding or Content-Length, that's actually quite
simple to cope with. It's only HTTP 1.0 read-till-it-closes that really
poses a problem, and even then it's not much of one -- you just use
read() in a loop, reading a fixed size each time and reallocating each
time. (Or doubling in size each time, perhaps).

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation




More information about the openconnect-devel mailing list