From cb699cff8d16425856a782bfc45bbd38fd19a628 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Mon, 17 Aug 2009 20:37:12 +0000 Subject: [PATCH] * if we decide whether we need to read another chunk, take into account if the buffer wasn't empty on start. --- webcit/tcp_sockets.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index 23fd9cf37..45c07ee79 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -523,6 +523,9 @@ int client_read_to(ParsedHttpHdrs *Hdr, StrBuf *Target, int bytes, int timeout) #ifdef HAVE_OPENSSL if (is_https) { long bufremain; + long baselen; + + baselen = StrLength(Target); if (Hdr->Pos == NULL) Hdr->Pos = ChrPtr(Hdr->ReadBuf); @@ -535,7 +538,7 @@ int client_read_to(ParsedHttpHdrs *Hdr, StrBuf *Target, int bytes, int timeout) if (bytes > bufremain) { - while ((StrLength(Hdr->ReadBuf) + StrLength(Target) < bytes) && + while ((StrLength(Hdr->ReadBuf) + StrLength(Target) < bytes + baselen) && (retval >= 0)) retval = client_read_sslbuffer(Hdr->ReadBuf, timeout); if (retval >= 0) { -- 2.30.2