cURL / Mailing Lists / curl-users / Single Mail

curl-users

PATCH for 7.0.X (-L and proxy set in environment variables)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 27 Jul 2000 12:43:18 +0200 (MET DST)

Well

When I tested using a similar setup, I experienced the same problems Jörn
reported a few hours ago.

The problem was introduced when I changed the environment variable reading
function, that has to alloc the string to be thread-safe in win32. I then
have to free the stuff after use, and I didn't clean up everything properly
at that point why it barfed the next time it tried to use one of those struct
fields.

So, in order to get your 7.0.X version work more properly (X should probably
be at least 2) apply this little patch:

--- lib/url.c~ Tue Jul 25 23:17:45 2000
+++ lib/url.c Thu Jul 27 12:27:03 2000
@@ -172,11 +172,15 @@
   }
 
   if(data->bits.proxystringalloc) {
- data->bits.proxystringalloc=0;
+ data->bits.proxystringalloc=FALSE;;
     free(data->proxy);
     data->proxy=NULL;
+
+ /* Since we allocated the string the previous round, it means that we
+ "discovered" the proxy in the environment variables and thus we must
+ switch off that knowledge again... */
+ data->bits.httpproxy=FALSE;
   }
-
 
   if(data->ptr_proxyuserpwd) {
     free(data->ptr_proxyuserpwd);

-- 
      Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Received on 2000-07-27