]> granicus.if.org Git - curl/commitdiff
lib/curl_schannel: Increased maximum buffer size to factor 128
authorMarc Hoersken <info@marc-hoersken.de>
Wed, 3 Oct 2012 16:15:41 +0000 (18:15 +0200)
committerMarc Hoersken <info@marc-hoersken.de>
Wed, 3 Oct 2012 16:15:41 +0000 (18:15 +0200)
lib/curl_schannel.c
lib/curl_schannel.h

index 8ae1131df5917914cb51f5ba64a89f7645fd4161..4fd676ea081b314678f18bbc3742d64f7a82cd6d 100644 (file)
@@ -302,7 +302,7 @@ schannel_connect_step2(struct connectdata *conn, int sockindex)
 
   /* if we need a bigger buffer to read a full message, increase buffer now */
   if(connssl->encdata_length - connssl->encdata_offset <
-     CURL_SCHANNEL_BUFFER_FREE_SIZE) {
+     CURL_SCHANNEL_BUFFER_MIN_SIZE) {
     if(connssl->encdata_length >= CURL_SCHANNEL_BUFFER_MAX_SIZE) {
       failf(data, "schannel: memory buffer size limit reached");
       return CURLE_OUT_OF_MEMORY;
@@ -831,7 +831,7 @@ schannel_recv(struct connectdata *conn, int sockindex,
 
   /* increase buffer in order to fit the requested amount of data */
   while(connssl->encdata_length - connssl->encdata_offset <
-        CURL_SCHANNEL_BUFFER_FREE_SIZE || connssl->encdata_length < len) {
+        CURL_SCHANNEL_BUFFER_MIN_SIZE || connssl->encdata_length < len) {
     if(connssl->encdata_length >= CURL_SCHANNEL_BUFFER_MAX_SIZE) {
       failf(data, "schannel: memory buffer size limit reached");
       *err = CURLE_OUT_OF_MEMORY;
@@ -907,8 +907,8 @@ schannel_recv(struct connectdata *conn, int sockindex,
               inbuf[1].cbBuffer);
 
         /* increase buffer in order to fit the received amount of data */
-        size = inbuf[1].cbBuffer > CURL_SCHANNEL_BUFFER_FREE_SIZE ?
-               inbuf[1].cbBuffer : CURL_SCHANNEL_BUFFER_FREE_SIZE;
+        size = inbuf[1].cbBuffer > CURL_SCHANNEL_BUFFER_MIN_SIZE ?
+               inbuf[1].cbBuffer : CURL_SCHANNEL_BUFFER_MIN_SIZE;
         while(connssl->decdata_length - connssl->decdata_offset < size ||
               connssl->decdata_length < len) {
           if(connssl->decdata_length >= CURL_SCHANNEL_BUFFER_MAX_SIZE) {
index ed925773132344c19bab8851bdad5b16f4446097..909ed1857f228a9de6d21a3ad190de382f1e1fcd 100644 (file)
 
 #ifdef BUFSIZE
 #define CURL_SCHANNEL_BUFFER_INIT_SIZE  BUFSIZE
-#define CURL_SCHANNEL_BUFFER_FREE_SIZE  BUFSIZE/2
 #else
 #define CURL_SCHANNEL_BUFFER_INIT_SIZE  4096
-#define CURL_SCHANNEL_BUFFER_FREE_SIZE  2048
 #endif
 
-#define CURL_SCHANNEL_BUFFER_MAX_SIZE     CURL_SCHANNEL_BUFFER_INIT_SIZE*16
-#define CURL_SCHANNEL_BUFFER_STEP_FACTOR  2
+#define CURL_SCHANNEL_BUFFER_MIN_SIZE    CURL_SCHANNEL_BUFFER_INIT_SIZE / 2
+#define CURL_SCHANNEL_BUFFER_MAX_SIZE    CURL_SCHANNEL_BUFFER_INIT_SIZE * 128
+#define CURL_SCHANNEL_BUFFER_STEP_FACTOR 2
 
 
 CURLcode Curl_schannel_connect(struct connectdata *conn, int sockindex);