* fix SSL posting
authorWilfried Göesgens <willi@citadel.org>
Sat, 27 Sep 2008 13:11:01 +0000 (13:11 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 27 Sep 2008 13:11:01 +0000 (13:11 +0000)
webcit/webserver.c

index bb140bc65421f8f442b3ef08fa3347ecf6f854dd..d66a008db00068d1900402646a714a0e1fdfe78d 100644 (file)
@@ -202,9 +202,9 @@ int client_read_to(int *sock, StrBuf *Target, StrBuf *Buf, int bytes, int timeou
        int retval = 0;
 
 #ifdef HAVE_OPENSSL
-       if (is_https) {//// TODO: loop; count till bytes is reached
-               bytes -= StrLength(Target);
-               while ((retval >= 0) && (StrLength(Buf) - StrLength(Target) < bytes))
+       if (is_https) {
+               while ((StrLength(Buf) + StrLength(Target) < bytes) &&
+                      (retval >= 0))
                        retval = client_read_sslbuffer(Buf, timeout);
                if (retval >= 0) {
                        StrBufAppendBuf(Target, Buf, 0); /// todo: Buf > bytes?