[PATCH] Increase maximum length of http response buffer

Adam Piątyszek ediap at users.sourceforge.net
Thu Feb 11 18:37:19 EST 2010


* David Woodhouse [10.02.2010 23:09]:
> 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).

I started to work on this tonight. Unfortunately, do not know why the
fetched CSD script cannot be successfully written from the extended
(reallocated) buffer. Error number is "Bad address" as the status of
write() function.

I will send a WIP patch in a separate email.

BR,
/Adam






More information about the openconnect-devel mailing list