Re: WGET for OS/2 and Proxy-Server

2001-05-17 Thread Hrvoje Niksic

Doug Kaufman [EMAIL PROTECTED] writes:

 if ((proxy = getenv(http_proxy)) == NULL) {
 proxy = getenv(HTTP_PROXY);
 }

That's what I plan to do.



Re: WGET for OS/2 and Proxy-Server

2001-05-16 Thread csaba . raduly

   
 
Hrvoje Niksic  
 
hniksic@arsdigitaTo: Wget List [EMAIL PROTECTED], 
Thomas Bohn  
.com [EMAIL PROTECTED]   
 
Sent by:  cc:  
 
[EMAIL PROTECTED]Subject: Re: WGET for OS/2 and 
Proxy-Server   
sdigita.de 
 
   
 
   
 
15/05/01 13:00 
 
   
 
   
 









 Thomas Bohn [EMAIL PROTECTED] writes:

  Hello,
 
  I tried to use WGET for OS/2 (tested V 1.5.3 and 1.6) with a proxy
  server. Without proxy server all works fine. But with...
 
  In a OS/2 commandline session I type the following commands:
 
  SET HTTP_PROXY=62.52.17.1:80

 Your proxy setting gets ignored.  Try using lower-case `http_proxy'.


It seems to me that getenv has some issues on OS/2.
Workaround: use .wgetrc commands instead.

All environment variale names (i.e. the part before the '=') are uppercase
on OS/2

wget uses getenv(http_proxy); the implementation of getenv seems to be
scanning _environ and doing a strncmp (i.e. case-sensitive comparison). If
getproxy in url.c is changed to getenv(HTTP_PROXY) then it does pick up
the environment setting.

Could we postulate that *ALL* environment vars influencing WGET be
uppercase ?
These are the places where getenv is used (excluding getopt.c)

init.c:237:  tmp = getenv (no_proxy);
init.c:259:  char *home = getenv (HOME);
init.c:292:  env = getenv (WGETRC);
url.c:1292:proxy = opt.http_proxy ? opt.http_proxy : getenv (http_proxy);
url.c:1294:proxy = opt.ftp_proxy ? opt.ftp_proxy : getenv (ftp_proxy);
url.c:1297:proxy = opt.https_proxy ? opt.https_proxy : getenv (https_proxy);
--
Csaba Ráduly, Software Engineer Sophos Anti-Virus
email: [EMAIL PROTECTED]  http://www.sophos.com
US support: +1 888 SOPHOS 9   UK Support: +44 1235 559933





Re: WGET for OS/2 and Proxy-Server

2001-05-16 Thread Doug Kaufman

On Wed, 16 May 2001 [EMAIL PROTECTED] wrote:

 All environment variale names (i.e. the part before the '=') are uppercase
 on OS/2
 
 wget uses getenv(http_proxy); the implementation of getenv seems to be
 scanning _environ and doing a strncmp (i.e. case-sensitive comparison). If
 getproxy in url.c is changed to getenv(HTTP_PROXY) then it does pick up
 the environment setting.
 
 Could we postulate that *ALL* environment vars influencing WGET be
 uppercase ?

These proxy environment variables are the only environment variables
that I know of whose standard names are lower case. This goes back
to the original implementation (I believe of libwww by CERN). It is
certainly conceivable that a machine could have different environment
variables http_proxy and HTTP_PROXY. Rather than uppercasing all
variables, you might consider something like:

if ((proxy = getenv(http_proxy)) == NULL) {
proxy = getenv(HTTP_PROXY);
}

The problem of *_proxy variables being lowercase has been discussed
several times on the lynx-dev mailing list. I suspect that it will
crop up in several applications and is not likely to go away.

  Doug
__ 
Doug Kaufman
Internet: [EMAIL PROTECTED]