diff --new-file --recursive --context=10 wget-1.7/ChangeLog wget-1.7a/ChangeLog
*** wget-1.7/ChangeLog	Mon Jun  4 06:33:49 2001
--- wget-1.7a/ChangeLog	Fri Aug 24 10:23:23 2001
***************
*** 1,10 ****
--- 1,15 ----
+ 2001-08-24  Peter Korman <jpk@ieee.org>
+ 
+ 	* updates to make wget work with socks5 -- this breaks socks4 compatibility
+ 	* which should be ok for new installs.
+ 
  2001-06-04  Hrvoje Niksic  <hniksic@arsdigita.com>
  
  	* po/: New versions of de.po and gl.po from the TP.
  
  2001-06-03  Hrvoje Niksic  <hniksic@arsdigita.com>
  
  	* po/hr.po: Updated to match the new POT.
  
  2001-06-03  Hrvoje Niksic  <hniksic@arsdigita.com>
  
diff --new-file --recursive --context=10 wget-1.7/configure wget-1.7a/configure
*** wget-1.7/configure	Mon Jun  4 07:29:36 2001
--- wget-1.7a/configure	Mon Aug 20 11:10:36 2001
***************
*** 3429,3466 ****
    cat >> confdefs.h <<EOF
  #define $ac_tr_lib 1
  EOF
  
    LIBS="-lresolv $LIBS"
  
  else
    echo "$ac_t""no" 1>&6
  fi
  
!   echo $ac_n "checking for Rconnect in -lsocks""... $ac_c" 1>&6
! echo "configure:3441: checking for Rconnect in -lsocks" >&5
! ac_lib_var=`echo socks'_'Rconnect | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_save_LIBS="$LIBS"
! LIBS="-lsocks  $LIBS"
  cat > conftest.$ac_ext <<EOF
  #line 3449 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char Rconnect();
  
  int main() {
! Rconnect()
  ; return 0; }
  EOF
  if { (eval echo configure:3460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
    echo "configure: failed program was:" >&5
    cat conftest.$ac_ext >&5
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=no"
--- 3429,3466 ----
    cat >> confdefs.h <<EOF
  #define $ac_tr_lib 1
  EOF
  
    LIBS="-lresolv $LIBS"
  
  else
    echo "$ac_t""no" 1>&6
  fi
  
!   echo $ac_n "checking for SOCKSconnect in -lsocks5""... $ac_c" 1>&6
! echo "configure:3441: checking for SOCKSconnect in -lsocks5" >&5
! ac_lib_var=`echo socks'_'SOCKSconnect | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_save_LIBS="$LIBS"
! LIBS="-lsocks5  $LIBS"
  cat > conftest.$ac_ext <<EOF
  #line 3449 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char SOCKSconnect();
  
  int main() {
! SOCKSconnect()
  ; return 0; }
  EOF
  if { (eval echo configure:3460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
    echo "configure: failed program was:" >&5
    cat conftest.$ac_ext >&5
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=no"
***************
*** 3470,3490 ****
  
  fi
  if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
    echo "$ac_t""yes" 1>&6
      ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
      -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
    cat >> confdefs.h <<EOF
  #define $ac_tr_lib 1
  EOF
  
!   LIBS="-lsocks $LIBS"
  
  else
    echo "$ac_t""no" 1>&6
  fi
  
  fi
  
  
  echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
  echo "configure:3491: checking "for runtime libraries flag"" >&5
--- 3470,3490 ----
  
  fi
  if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
    echo "$ac_t""yes" 1>&6
      ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
      -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
    cat >> confdefs.h <<EOF
  #define $ac_tr_lib 1
  EOF
  
!   LIBS="-lsocks5 $LIBS"
  
  else
    echo "$ac_t""no" 1>&6
  fi
  
  fi
  
  
  echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
  echo "configure:3491: checking "for runtime libraries flag"" >&5
diff --new-file --recursive --context=10 wget-1.7/configure.in wget-1.7a/configure.in
*** wget-1.7/configure.in	Mon May 28 18:02:47 2001
--- wget-1.7a/configure.in	Mon Aug 20 11:08:21 2001
***************
*** 183,203 ****
  dnl
  dnl Checks for libraries.
  dnl
  
  AC_CHECK_LIB(socket, socket)
  
  dnl #### This appears to be deficient with later versions of SOCKS.
  if test "x${with_socks}" = xyes
  then
    AC_CHECK_LIB(resolv, main)
!   AC_CHECK_LIB(socks, Rconnect)
  fi
  
  dnl OpenSSL is a third-party library, which makes checking for it a
  dnl pain.  Before proceeding, we need to figure out whether to use the
  dnl `-R' flag.
  
  dnl Try to autodetect runtime library flag (usually -R), and whether
  dnl it works (or at least does no harm).  Note that this is used
  dnl merely for the configure test below.  The actual linking is
  dnl performed by libtool.  Wouldn't it be nice if libtool also
--- 183,203 ----
  dnl
  dnl Checks for libraries.
  dnl
  
  AC_CHECK_LIB(socket, socket)
  
  dnl #### This appears to be deficient with later versions of SOCKS.
  if test "x${with_socks}" = xyes
  then
    AC_CHECK_LIB(resolv, main)
!   AC_CHECK_LIB(socks5, SOCKSconnect)
  fi
  
  dnl OpenSSL is a third-party library, which makes checking for it a
  dnl pain.  Before proceeding, we need to figure out whether to use the
  dnl `-R' flag.
  
  dnl Try to autodetect runtime library flag (usually -R), and whether
  dnl it works (or at least does no harm).  Note that this is used
  dnl merely for the configure test below.  The actual linking is
  dnl performed by libtool.  Wouldn't it be nice if libtool also
diff --new-file --recursive --context=10 wget-1.7/src/alloca.c wget-1.7a/src/alloca.c
*** wget-1.7/src/alloca.c	Thu Dec  2 02:42:27 1999
--- wget-1.7a/src/alloca.c	Thu Aug 23 13:56:06 2001
***************
*** 230,250 ****
  
      return (pointer) ((char *) new + sizeof (header));
    }
  }
  
  #if defined (CRAY) && defined (CRAY_STACKSEG_END)
  
  #ifdef DEBUG_I00AFUNC
  #include <stdio.h>
  #endif
! 
  #ifndef CRAY_STACK
  #define CRAY_STACK
  #ifndef CRAY2
  /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
  struct stack_control_header
    {
      long shgrow:32;		/* Number of times stack has grown.  */
      long shaseg:32;		/* Size of increments to stack.  */
      long shhwm:32;		/* High water mark of stack.  */
      long shsize:32;		/* Current size of stack (all segments).  */
--- 230,250 ----
  
      return (pointer) ((char *) new + sizeof (header));
    }
  }
  
  #if defined (CRAY) && defined (CRAY_STACKSEG_END)
  
  #ifdef DEBUG_I00AFUNC
  #include <stdio.h>
  #endif
! #include "socks_stuff.h"
  #ifndef CRAY_STACK
  #define CRAY_STACK
  #ifndef CRAY2
  /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
  struct stack_control_header
    {
      long shgrow:32;		/* Number of times stack has grown.  */
      long shaseg:32;		/* Size of increments to stack.  */
      long shhwm:32;		/* High water mark of stack.  */
      long shsize:32;		/* Current size of stack (all segments).  */
diff --new-file --recursive --context=10 wget-1.7/src/ansi2knr.c wget-1.7a/src/ansi2knr.c
*** wget-1.7/src/ansi2knr.c	Thu Dec  2 02:42:26 1999
--- wget-1.7a/src/ansi2knr.c	Thu Aug 23 13:56:22 2001
***************
*** 78,97 ****
--- 78,98 ----
  /* Most of the conditionals here are to make ansi2knr work with */
  /* or without the GNU configure machinery. */
  
  #if HAVE_CONFIG_H
  # include <config.h>
  #endif
  
  #include <stdio.h>
  #include <ctype.h>
  
+ #include "socks_stuff.h"
  #if HAVE_CONFIG_H
  
  /*
     For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h).
     This will define HAVE_CONFIG_H and so, activate the following lines.
   */
  
  # if STDC_HEADERS || HAVE_STRING_H
  #  include <string.h>
  # else
diff --new-file --recursive --context=10 wget-1.7/src/cmpt.c wget-1.7a/src/cmpt.c
*** wget-1.7/src/cmpt.c	Sun May 27 15:34:54 2001
--- wget-1.7a/src/cmpt.c	Thu Aug 23 13:56:41 2001
***************
*** 28,47 ****
--- 28,48 ----
  #endif /* HAVE_STRING_H */
  
  #include <sys/types.h>
  #ifdef HAVE_UNISTD_H
  # include <unistd.h>
  #endif
  #include <limits.h>
  
  #include "wget.h"
  
+ #include "socks_stuff.h"
  #ifndef HAVE_STRERROR
  /* A strerror() clone, for systems that don't have it.  */
  char *
  strerror (int err)
  {
    /* This loses on a system without `sys_errlist'.  */
    extern char *sys_errlist[];
    return sys_errlist[err];
  }
  #endif /* not HAVE_STRERROR */
diff --new-file --recursive --context=10 wget-1.7/src/connect.c wget-1.7a/src/connect.c
*** wget-1.7/src/connect.c	Sun May 27 15:34:55 2001
--- wget-1.7a/src/connect.c	Thu Aug 23 14:08:45 2001
***************
*** 40,60 ****
  #else
  # include <strings.h>
  #endif /* HAVE_STRING_H */
  #ifdef HAVE_SYS_SELECT_H
  # include <sys/select.h>
  #endif /* HAVE_SYS_SELECT_H */
  
  #include "wget.h"
  #include "connect.h"
  #include "host.h"
! 
  #ifndef errno
  extern int errno;
  #endif
  
  /* Variables shared by bindport and acceptport: */
  static int msock = -1;
  static struct sockaddr *addr;
  
  
  /* Create an internet connection to HOSTNAME on PORT.  The created
--- 40,60 ----
  #else
  # include <strings.h>
  #endif /* HAVE_STRING_H */
  #ifdef HAVE_SYS_SELECT_H
  # include <sys/select.h>
  #endif /* HAVE_SYS_SELECT_H */
  
  #include "wget.h"
  #include "connect.h"
  #include "host.h"
! #include "socks_stuff.h"
  #ifndef errno
  extern int errno;
  #endif
  
  /* Variables shared by bindport and acceptport: */
  static int msock = -1;
  static struct sockaddr *addr;
  
  
  /* Create an internet connection to HOSTNAME on PORT.  The created
diff --new-file --recursive --context=10 wget-1.7/src/cookies.c wget-1.7a/src/cookies.c
*** wget-1.7/src/cookies.c	Sun May 27 15:34:56 2001
--- wget-1.7a/src/cookies.c	Thu Aug 23 13:57:35 2001
***************
*** 30,49 ****
--- 30,50 ----
  #endif
  #include <stdlib.h>
  #include <assert.h>
  #include <errno.h>
  
  #include "wget.h"
  #include "utils.h"
  #include "hash.h"
  #include "url.h"
  #include "cookies.h"
+ #include "socks_stuff.h"
  
  /* Hash table that maps domain names to cookie chains. */
  
  static struct hash_table *cookies_hash_table;
  
  /* This should be set by entry points in this file, so the low-level
     functions don't need to call time() all the time.  */
  
  static time_t cookies_now;
  
diff --new-file --recursive --context=10 wget-1.7/src/fnmatch.c wget-1.7a/src/fnmatch.c
*** wget-1.7/src/fnmatch.c	Sun May 27 15:34:56 2001
--- wget-1.7a/src/fnmatch.c	Thu Aug 23 13:57:50 2001
***************
*** 19,38 ****
--- 19,39 ----
  
  /* NOTE: Some Un*xes have their own fnmatch() -- yet, they are
     reportedly unreliable and buggy.  Thus I chose never to use it;
     this version (from GNU Bash) is used unconditionally.  */
  
  #include <config.h>
  
  #include <errno.h>
  #include "wget.h"
  #include "fnmatch.h"
+ #include "socks_stuff.h"
  
  /* Match STRING against the filename pattern PATTERN, returning zero
     if it matches, FNM_NOMATCH if not.  */
  int
  fnmatch (const char *pattern, const char *string, int flags)
  {
    register const char *p = pattern, *n = string;
    register char c;
  
    if ((flags & ~__FNM_FLAGS) != 0)
diff --new-file --recursive --context=10 wget-1.7/src/ftp-basic.c wget-1.7a/src/ftp-basic.c
*** wget-1.7/src/ftp-basic.c	Sun May 27 15:34:57 2001
--- wget-1.7a/src/ftp-basic.c	Thu Aug 23 13:58:19 2001
***************
*** 34,53 ****
--- 34,54 ----
  #ifdef WINDOWS
  # include <winsock.h>
  #endif
  
  #include "wget.h"
  #include "utils.h"
  #include "rbuf.h"
  #include "connect.h"
  #include "host.h"
  #include "ftp.h"
+ #include "socks_stuff.h"
  
  char ftp_last_respline[128];
  
  
  /* Get the response of FTP server and allocate enough room to handle
     it.  <CR> and <LF> characters are stripped from the line, and the
     line is 0-terminated.  All the response lines but the last one are
     skipped.  The last line is determined as described in RFC959.  */
  uerr_t
  ftp_response (struct rbuf *rbuf, char **line)
diff --new-file --recursive --context=10 wget-1.7/src/ftp-ls.c wget-1.7a/src/ftp-ls.c
*** wget-1.7/src/ftp-ls.c	Sun Jun  3 09:26:41 2001
--- wget-1.7a/src/ftp-ls.c	Thu Aug 23 13:58:55 2001
***************
*** 30,49 ****
--- 30,50 ----
  #ifdef HAVE_UNISTD_H
  # include <unistd.h>
  #endif
  #include <sys/types.h>
  #include <errno.h>
  
  #include "wget.h"
  #include "utils.h"
  #include "ftp.h"
  #include "url.h"
+ #include "socks_stuff.h"
  
  /* Converts symbolic permissions to number-style ones, e.g. string
     rwxr-xr-x to 755.  For now, it knows nothing of
     setuid/setgid/sticky.  ACLs are ignored.  */
  static int
  symperms (const char *s)
  {
    int perms = 0, i;
  
    if (strlen (s) < 9)
diff --new-file --recursive --context=10 wget-1.7/src/ftp-opie.c wget-1.7a/src/ftp-opie.c
*** wget-1.7/src/ftp-opie.c	Sun May 27 15:34:58 2001
--- wget-1.7a/src/ftp-opie.c	Thu Aug 23 13:59:11 2001
***************
*** 22,41 ****
--- 22,42 ----
  #include <stdio.h>
  #include <stdlib.h>
  #ifdef HAVE_STRING_H
  # include <string.h>
  #else
  # include <strings.h>
  #endif
  
  #include "wget.h"
  #include "md5.h"
+ #include "socks_stuff.h"
  
  /* Dictionary for integer-word translations.  */
  static char Wp[2048][4] = {
    { 'A', '\0', '\0', '\0' },
    { 'A', 'B', 'E', '\0' },
    { 'A', 'C', 'E', '\0' },
    { 'A', 'C', 'T', '\0' },
    { 'A', 'D', '\0', '\0' },
    { 'A', 'D', 'A', '\0' },
    { 'A', 'D', 'D', '\0' },
diff --new-file --recursive --context=10 wget-1.7/src/ftp.c wget-1.7a/src/ftp.c
*** wget-1.7/src/ftp.c	Sun May 27 15:34:58 2001
--- wget-1.7a/src/ftp.c	Thu Aug 23 13:58:36 2001
***************
*** 40,59 ****
--- 40,60 ----
  #include "wget.h"
  #include "utils.h"
  #include "url.h"
  #include "rbuf.h"
  #include "retr.h"
  #include "ftp.h"
  #include "connect.h"
  #include "host.h"
  #include "fnmatch.h"
  #include "netrc.h"
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  #ifndef h_errno
  # ifndef __CYGWIN__
  extern int h_errno;
  # endif
  #endif
  
diff --new-file --recursive --context=10 wget-1.7/src/gen_sslfunc.c wget-1.7a/src/gen_sslfunc.c
*** wget-1.7/src/gen_sslfunc.c	Sun May 27 15:34:59 2001
--- wget-1.7a/src/gen_sslfunc.c	Thu Aug 23 13:59:45 2001
***************
*** 27,46 ****
--- 27,47 ----
  
  #include <openssl/bio.h>
  #include <openssl/crypto.h>
  #include <openssl/x509.h>
  #include <openssl/ssl.h>
  #include <openssl/err.h>
  #include <openssl/pem.h>
  
  #include "wget.h"
  #include "connect.h"
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  
  static int verify_callback PARAMS ((int, X509_STORE_CTX *));
  
  /* Creates a SSL Context and sets some defaults for it */
  uerr_t
  init_ssl (SSL_CTX **ctx)
diff --new-file --recursive --context=10 wget-1.7/src/getopt.c wget-1.7a/src/getopt.c
*** wget-1.7/src/getopt.c	Thu Dec  2 02:42:26 1999
--- wget-1.7a/src/getopt.c	Thu Aug 23 14:00:19 2001
***************
*** 156,175 ****
--- 156,176 ----
  {
    REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
  } ordering;
  
  #ifdef        __GNU_LIBRARY__
  /* We want to avoid inclusion of string.h with non-GNU libraries
     because there are many ways it can cause trouble.
     On some systems, it contains special magic macros that don't work
     in GCC.  */
  #include <string.h>
+ #include "socks_stuff.h"
  #define        my_index        strchr
  #define        my_bcopy(src, dst, n)        memcpy ((dst), (src), (n))
  #else
  
  /* Avoid depending on library functions or files
     whose names are inconsistent.  */
  
  char *getenv ();
  
  static char *
diff --new-file --recursive --context=10 wget-1.7/src/godiva.vf.lotus.com/index.html wget-1.7a/src/godiva.vf.lotus.com/index.html
*** wget-1.7/src/godiva.vf.lotus.com/index.html	Wed Dec 31 19:00:00 1969
--- wget-1.7a/src/godiva.vf.lotus.com/index.html	Thu Mar 29 12:53:01 2001
***************
*** 0 ****
--- 1,86 ----
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ <HTML>
+  <HEAD>
+   <TITLE>Test Page for the Apache Web Server on Red Hat Linux</TITLE>
+  </HEAD>
+ <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
+  <BODY BGCOLOR="#FFFFFF">
+ 
+   <H1 ALIGN="CENTER">Test Page</H1>
+   This page is used to test the proper operation of the Apache Web server after
+   it has been installed.  If you can read this page, it means that the Apache
+   Web server installed at this site is working properly.
+ 
+   <HR WIDTH="50%">
+ 
+   <H2 ALIGN="CENTER">If you are the administrator of this website:</H2>
+   <P>
+   You may now add content to this directory, and replace this page.  Note that
+   until you do so, people visiting your website will see this page, and not your
+   content.
+   </P>
+ 
+   <P>If you have upgraded from Red Hat Linux 6.2 and earlier, then you are
+   seeing this page because the default <A
+   href="manual/mod/core.html#documentroot"><STRONG>DocumentRoot</STRONG></A>
+   set in <TT>/etc/httpd/conf/httpd.conf</TT> has changed.  Any subdirectories
+   which existed under <TT>/home/httpd</TT> should now be moved to
+   <TT>/var/www</TT>.  Alternatively, the contents of <TT>/var/www</TT> can be
+   moved to <TT>/home/httpd</TT>, and the configuration file can be updated
+   accordingly.
+   </P>
+ 
+   <HR WIDTH="50%">
+   <H2 ALIGN="CENTER">If you are a member of the general public:</H2>
+ 
+   <P>
+   The fact that you are seeing this page indicates that the website you just
+   visited is either experiencing problems, or is undergoing routine maintenance.
+   </P>
+ 
+   <P>
+   If you would like to let the administrators of this website know that you've
+   seen this page instead of the page you expected, you should send them e-mail.
+   In general, mail sent to the name "webmaster" and directed to the website's
+   domain should reach the appropriate person.
+   </P>
+ 
+   <P>
+   For example, if you experienced problems while visiting www.example.com,
+   you should send e-mail to "webmaster@example.com".
+   </P>
+ 
+   <HR WIDTH="50%">
+ 
+   <P>
+   The Apache <A HREF="manual/index.html" >documentation</A> has been included
+   with this distribution.
+   </P>
+ 
+   <P>
+   For documentation and information on Red Hat Linux, please visit the
+   <a href="http://www.redhat.com/">Red Hat, Inc.</a> website. The manual for
+   Red Hat Linux is available <a href="http://www.redhat.com/manual">here</a>.
+   </P>
+ 
+   <P>
+   You are free to use the image below on an Apache-powered Web
+   server.  Thanks for using Apache!
+   </P>
+ 
+   <P ALIGN="CENTER">
+   <A HREF="http://www.apache.org/"><IMG SRC="/icons/apache_pb.gif" ALT="[ Powered
+ by Apache ]"></A>
+   </P>
+ 
+   <P>
+   You are free to use the image below on a Red Hat Linux-powered Web
+   server. Thanks for using Red Hat Linux!
+   </P>
+ 
+   <P ALIGN="center">
+   <A HREF="http://www.redhat.com/"><IMG SRC="poweredby.png" ALT="[ Powered
+ by Red Hat Linux ]"></A>
+   </P>
+  </BODY>
+ </HTML>
diff --new-file --recursive --context=10 wget-1.7/src/hash.c wget-1.7a/src/hash.c
*** wget-1.7/src/hash.c	Sun May 27 15:35:00 2001
--- wget-1.7a/src/hash.c	Thu Aug 23 14:00:49 2001
***************
*** 546,565 ****
--- 546,566 ----
    key += (key << 7);
    key ^= (key >> 12);
    return key;
  }
  #endif
  
  #ifdef STANDALONE
  
  #include <stdio.h>
  #include <string.h>
+ #include "socks_stuff.h"
  
  int
  print_hash_table_mapper (void *key, void *value, void *count)
  {
    ++*(int *)count;
    printf ("%s: %s\n", (const char *)key, (char *)value);
    return 0;
  }
  
  void
diff --new-file --recursive --context=10 wget-1.7/src/headers.c wget-1.7a/src/headers.c
*** wget-1.7/src/headers.c	Sun May 27 15:35:00 2001
--- wget-1.7a/src/headers.c	Thu Aug 23 14:01:03 2001
***************
*** 24,43 ****
--- 24,44 ----
  #ifdef HAVE_STRING_H
  # include <string.h>
  #else
  # include <strings.h>
  #endif
  
  #include "wget.h"
  #include "connect.h"
  #include "rbuf.h"
  #include "headers.h"
+ #include "socks_stuff.h"
  
  /* This file contains the generic routines for work with headers.
     Currently they are used only by HTTP in http.c, but they can be
     used by anything that cares about RFC822-style headers.
  
     Header is defined in RFC2068, as quoted below.  Note that this
     definition is not HTTP-specific -- it is virtually
     indistinguishable from the one given in RFC822 or RFC1036.
  
  	message-header = field-name ":" [ field-value ] CRLF
diff --new-file --recursive --context=10 wget-1.7/src/host.c wget-1.7a/src/host.c
*** wget-1.7/src/host.c	Sun May 27 15:35:01 2001
--- wget-1.7a/src/host.c	Thu Aug 23 14:01:25 2001
***************
*** 41,60 ****
--- 41,61 ----
  #ifdef HAVE_SYS_UTSNAME_H
  # include <sys/utsname.h>
  #endif
  #include <errno.h>
  
  #include "wget.h"
  #include "utils.h"
  #include "host.h"
  #include "url.h"
  #include "hash.h"
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  
  /* Mapping between all known hosts to their addresses (n.n.n.n). */
  struct hash_table *host_name_address_map;
  
  /* Mapping between all known addresses (n.n.n.n) to their hosts.  This
     is the inverse of host_name_address_map.  These two tables share
diff --new-file --recursive --context=10 wget-1.7/src/html-parse.c wget-1.7a/src/html-parse.c
*** wget-1.7/src/html-parse.c	Sun May 27 15:35:01 2001
--- wget-1.7a/src/html-parse.c	Thu Aug 23 14:01:43 2001
***************
*** 87,106 ****
--- 87,107 ----
  #include <stdlib.h>
  #ifdef HAVE_STRING_H
  # include <string.h>
  #else
  # include <strings.h>
  #endif
  #include <assert.h>
  
  #include "wget.h"
  #include "html-parse.h"
+ #include "socks_stuff.h"
  
  #ifdef STANDALONE
  # define xmalloc malloc
  # define xrealloc realloc
  # define xfree free
  #endif /* STANDALONE */
  
  /* Pool support.  For efficiency, map_html_tags() stores temporary
     string data to a single stack-allocated pool.  If the pool proves
     too small, additional memory is allocated/resized with
diff --new-file --recursive --context=10 wget-1.7/src/html-url.c wget-1.7a/src/html-url.c
*** wget-1.7/src/html-url.c	Sun May 27 15:35:02 2001
--- wget-1.7a/src/html-url.c	Thu Aug 23 14:02:02 2001
***************
*** 26,45 ****
--- 26,46 ----
  # include <strings.h>
  #endif
  #include <stdlib.h>
  #include <errno.h>
  #include <assert.h>
  
  #include "wget.h"
  #include "html-parse.h"
  #include "url.h"
  #include "utils.h"
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  
  enum tag_category { TC_LINK, TC_SPEC };
  
  /* Here we try to categorize the known tags.  Each tag has its ID and
     cetegory.  Category TC_LINK means that one or more of its
     attributes contain links that should be retrieved.  TC_SPEC means
diff --new-file --recursive --context=10 wget-1.7/src/http.c wget-1.7a/src/http.c
*** wget-1.7/src/http.c	Sun May 27 15:35:02 2001
--- wget-1.7a/src/http.c	Thu Aug 23 14:02:17 2001
***************
*** 60,79 ****
--- 60,80 ----
  #include "connect.h"
  #include "fnmatch.h"
  #include "netrc.h"
  #if USE_DIGEST
  # include "md5.h"
  #endif
  #ifdef HAVE_SSL
  # include "gen_sslfunc.h"
  #endif /* HAVE_SSL */
  #include "cookies.h"
+ #include "socks_stuff.h"
  
  extern char *version_string;
  
  #ifndef errno
  extern int errno;
  #endif
  #ifndef h_errno
  # ifndef __CYGWIN__
  extern int h_errno;
  # endif
diff --new-file --recursive --context=10 wget-1.7/src/init.c wget-1.7a/src/init.c
*** wget-1.7/src/init.c	Sun May 27 15:35:04 2001
--- wget-1.7a/src/init.c	Thu Aug 23 14:02:43 2001
***************
*** 45,64 ****
--- 45,65 ----
  #include <pwd.h>
  #endif
  
  #include "wget.h"
  #include "utils.h"
  #include "init.h"
  #include "host.h"
  #include "recur.h"
  #include "netrc.h"
  #include "cookies.h"		/* for cookies_cleanup */
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  
  /* We want tilde expansion enabled only when reading `.wgetrc' lines;
     otherwise, it will be performed by the shell.  This variable will
     be set by the wgetrc-reading function.  */
  
  static int enable_tilde_expansion;
diff --new-file --recursive --context=10 wget-1.7/src/log.c wget-1.7a/src/log.c
*** wget-1.7/src/log.c	Sun May 27 15:35:05 2001
--- wget-1.7a/src/log.c	Thu Aug 23 14:03:03 2001
***************
*** 33,52 ****
--- 33,53 ----
  # include <varargs.h>
  #endif
  #ifdef HAVE_UNISTD_H
  # include <unistd.h>
  #endif
  #include <assert.h>
  #include <errno.h>
  
  #include "wget.h"
  #include "utils.h"
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  
  /* The file descriptor used for logging. */
  
  static FILE *logfp;
  
  /* Whether logging is saved at all.  */
diff --new-file --recursive --context=10 wget-1.7/src/main.c wget-1.7a/src/main.c
*** wget-1.7/src/main.c	Sun May 27 15:35:05 2001
--- wget-1.7a/src/main.c	Thu Aug 23 14:03:23 2001
***************
*** 44,63 ****
--- 44,64 ----
  #define OPTIONS_DEFINED_HERE	/* for options.h */
  
  #include "wget.h"
  #include "utils.h"
  #include "getopt.h"
  #include "init.h"
  #include "retr.h"
  #include "recur.h"
  #include "host.h"
  #include "cookies.h"
+ #include "socks_stuff.h"
  
  #ifndef PATH_SEPARATOR
  # define PATH_SEPARATOR '/'
  #endif
  
  extern char *version_string;
  
  #ifndef errno
  extern int errno;
  #endif
diff --new-file --recursive --context=10 wget-1.7/src/md5.c wget-1.7a/src/md5.c
*** wget-1.7/src/md5.c	Thu Dec  2 02:42:28 1999
--- wget-1.7a/src/md5.c	Thu Aug 23 14:04:05 2001
***************
*** 48,67 ****
--- 48,68 ----
  # endif
  #endif
  
  #ifdef WORDS_BIGENDIAN
  # define SWAP(n)							\
      (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
  #else
  # define SWAP(n) (n)
  #endif
  
+ #include "socks_stuff.h"
  
  /* This array contains the bytes used to pad the buffer to the next
     64-byte boundary.  (RFC 1321, 3.1: Step 1)  */
  static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */ };
  
  
  /* Initialize structure containing state of computation.
     (RFC 1321, 3.3: Step 3)  */
  void
  md5_init_ctx (struct md5_ctx *ctx)
diff --new-file --recursive --context=10 wget-1.7/src/mswindows.c wget-1.7a/src/mswindows.c
*** wget-1.7/src/mswindows.c	Sun May 27 15:35:06 2001
--- wget-1.7a/src/mswindows.c	Thu Aug 23 14:04:20 2001
***************
*** 24,43 ****
--- 24,44 ----
  #include <stdio.h>
  #include <stdlib.h>
  #include <winsock.h>
  #include <string.h>
  #include <assert.h>
  #include <errno.h>
  
  #include "wget.h"
  #include "url.h"
  
+ #include "socks_stuff.h"
  #ifndef errno
  extern int errno;
  #endif
  
  /* Defined in log.c.  */
  void redirect_output (const char *);
  
  static int windows_nt_p;
  
  
diff --new-file --recursive --context=10 wget-1.7/src/netrc.c wget-1.7a/src/netrc.c
*** wget-1.7/src/netrc.c	Sun May 27 15:35:07 2001
--- wget-1.7a/src/netrc.c	Thu Aug 23 14:04:48 2001
***************
*** 442,462 ****
        FREE_MAYBE (l->passwd);
        FREE_MAYBE (l->host);
        xfree (l);
        l = t;
      }
  }
  
  #ifdef STANDALONE
  #include <sys/types.h>
  #include <sys/stat.h>
! 
  int
  main (int argc, char **argv)
  {
    struct stat sb;
    char *program_name, *file, *target;
    acc_t *head, *a;
  
    if (argc < 2 || argc > 3)
      {
        fprintf (stderr, _("Usage: %s NETRC [HOSTNAME]\n"), argv[0]);
--- 442,462 ----
        FREE_MAYBE (l->passwd);
        FREE_MAYBE (l->host);
        xfree (l);
        l = t;
      }
  }
  
  #ifdef STANDALONE
  #include <sys/types.h>
  #include <sys/stat.h>
! #include "socks_stuff.h"
  int
  main (int argc, char **argv)
  {
    struct stat sb;
    char *program_name, *file, *target;
    acc_t *head, *a;
  
    if (argc < 2 || argc > 3)
      {
        fprintf (stderr, _("Usage: %s NETRC [HOSTNAME]\n"), argv[0]);
diff --new-file --recursive --context=10 wget-1.7/src/rbuf.c wget-1.7a/src/rbuf.c
*** wget-1.7/src/rbuf.c	Sun May 27 15:35:09 2001
--- wget-1.7a/src/rbuf.c	Thu Aug 23 14:05:11 2001
***************
*** 28,47 ****
--- 28,48 ----
  #include "connect.h"
  
  #ifdef HAVE_SSL
  #include <openssl/bio.h>
  #include <openssl/crypto.h>
  #include <openssl/x509.h>
  #include <openssl/ssl.h>
  #include <openssl/err.h>
  #include <openssl/pem.h>
  #endif /* HAVE_SSL */
+ #include "socks_stuff.h"
  
  void
  rbuf_initialize (struct rbuf *rbuf, int fd)
  {
    rbuf->fd = fd;
  #ifdef HAVE_SSL
  /* pointing ssl to NULL results in an unchanged behaviour */
    rbuf->ssl = NULL;
  #endif /* HAVE_SSL */
    rbuf->buffer_pos = rbuf->buffer;
diff --new-file --recursive --context=10 wget-1.7/src/recur.c wget-1.7a/src/recur.c
*** wget-1.7/src/recur.c	Sun May 27 15:35:09 2001
--- wget-1.7a/src/recur.c	Thu Aug 23 14:05:38 2001
***************
*** 35,54 ****
--- 35,55 ----
  
  #include "wget.h"
  #include "url.h"
  #include "recur.h"
  #include "utils.h"
  #include "retr.h"
  #include "ftp.h"
  #include "fnmatch.h"
  #include "host.h"
  #include "hash.h"
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  
  extern char *version_string;
  
  #define ROBOTS_FILENAME "robots.txt"
  
  static struct hash_table *dl_file_url_map;
diff --new-file --recursive --context=10 wget-1.7/src/retr.c wget-1.7a/src/retr.c
*** wget-1.7/src/retr.c	Sun May 27 15:35:09 2001
--- wget-1.7a/src/retr.c	Thu Aug 23 14:06:09 2001
***************
*** 35,54 ****
--- 35,55 ----
  
  #include "wget.h"
  #include "utils.h"
  #include "retr.h"
  #include "url.h"
  #include "recur.h"
  #include "ftp.h"
  #include "host.h"
  #include "connect.h"
  #include "hash.h"
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  
  /* See the comment in gethttp() why this is needed. */
  int global_download_count;
  
  void logflush PARAMS ((void));
  
diff --new-file --recursive --context=10 wget-1.7/src/safe-ctype.c wget-1.7a/src/safe-ctype.c
*** wget-1.7/src/safe-ctype.c	Fri Mar 30 17:36:59 2001
--- wget-1.7a/src/safe-ctype.c	Thu Aug 23 14:06:24 2001
***************
*** 25,44 ****
--- 25,45 ----
     - Implements all isxxx() macros required by C99.
     - Also implements some character classes useful when
       parsing C-like languages.
     - Does not change behavior depending on the current locale.
     - Behaves properly for all values in the range of a signed or
       unsigned char.  */
  
  #include <config.h>
  #include <safe-ctype.h>
  #include <stdio.h>  /* for EOF */
+ #include "socks_stuff.h"
  
  /* Shorthand */
  #define bl _sch_isblank
  #define cn _sch_iscntrl
  #define di _sch_isdigit
  #define is _sch_isidst
  #define lo _sch_islower
  #define nv _sch_isnvsp
  #define pn _sch_ispunct
  #define pr _sch_isprint
diff --new-file --recursive --context=10 wget-1.7/src/snprintf.c wget-1.7a/src/snprintf.c
*** wget-1.7/src/snprintf.c	Tue Apr 24 20:20:29 2001
--- wget-1.7a/src/snprintf.c	Thu Aug 23 14:06:40 2001
***************
*** 802,821 ****
--- 802,822 ----
    total = vsnprintf(str, count, fmt, ap);
    VA_END;
    return total;
  }
  #endif /* !HAVE_SNPRINTF */
  #endif /* !HAVE_SNPRINTF || !HAVE_VSNPRINTF */
  
  #ifdef TEST_SNPRINTF
  
  #include <stdio.h>
+ #include "socks_stuff.h"
  
  #ifndef LONG_STRING
  #define LONG_STRING 1024
  #endif
  int main (void)
  {
    char buf1[LONG_STRING];
    char buf2[LONG_STRING];
    char *fp_fmt[] = {
      "%-1.5f",
diff --new-file --recursive --context=10 wget-1.7/src/socks_stuff.h wget-1.7a/src/socks_stuff.h
*** wget-1.7/src/socks_stuff.h	Wed Dec 31 19:00:00 1969
--- wget-1.7a/src/socks_stuff.h	Thu Aug 23 14:11:26 2001
***************
*** 0 ****
--- 1,9 ----
+ #ifndef _SOCKS_STUFF_H_
+ #  define _SOCKS_STUFF_H_
+ #  ifdef HAVE_SOCKS
+ #    if ( 0 != HAVE_SOCKS )
+ #      define SOCKS
+ #      include <socks.h>
+ #    endif
+ #  endif
+ #endif
diff --new-file --recursive --context=10 wget-1.7/src/url.c wget-1.7a/src/url.c
*** wget-1.7/src/url.c	Sun May 27 15:35:10 2001
--- wget-1.7a/src/url.c	Thu Aug 23 14:07:00 2001
***************
*** 30,49 ****
--- 30,50 ----
  #ifdef HAVE_UNISTD_H
  # include <unistd.h>
  #endif
  #include <errno.h>
  #include <assert.h>
  
  #include "wget.h"
  #include "utils.h"
  #include "url.h"
  #include "host.h"
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  
  /* Is X "."?  */
  #define DOTP(x) ((*(x) == '.') && (!*(x + 1)))
  /* Is X ".."?  */
  #define DDOTP(x) ((*(x) == '.') && (*(x + 1) == '.') && (!*(x + 2)))
  
diff --new-file --recursive --context=10 wget-1.7/src/utils.c wget-1.7a/src/utils.c
*** wget-1.7/src/utils.c	Sun May 27 15:35:12 2001
--- wget-1.7a/src/utils.c	Thu Aug 23 14:07:16 2001
***************
*** 48,67 ****
--- 48,68 ----
  #ifdef NeXT
  # include <libc.h>		/* for access() */
  #endif
  #include <fcntl.h>
  #include <assert.h>
  
  #include "wget.h"
  #include "utils.h"
  #include "fnmatch.h"
  #include "hash.h"
+ #include "socks_stuff.h"
  
  #ifndef errno
  extern int errno;
  #endif
  
  /* This section implements several wrappers around the basic
     allocation routines.  This is done for two reasons: first, so that
     the callers of these functions need not consistently check for
     errors.  If there is not enough virtual memory for running Wget,
     something is seriously wrong, and Wget exits with an appropriate
