diff -ur wget-1.8/src/connect.c wget/src/connect.c --- wget-1.8/src/connect.c Tue Nov 27 09:55:40 2001 +++ wget/src/connect.c Tue Apr 16 23:21:27 2002 @@ -50,6 +50,7 @@ #include "wget.h" #include "connect.h" #include "host.h" +#include "../../host_info.h" #ifndef errno extern int errno; @@ -79,6 +80,7 @@ connect_to_one (const unsigned char *addr, unsigned short port, int silent) { struct sockaddr_in sock_name; + struct host_info hosti; int sock, save_errno; /* Set port and protocol */ @@ -114,6 +116,16 @@ goto out; } } + + /* set "socket" option */ + hosti.snd_host_len = strlen (connection_host_name); + hosti.rcv_host_len = 0; + memcpy (hosti.snd_host, connection_host_name, hosti.snd_host_len); + //memcpy (hosti.rcv_host, connection_host_name, hosti.rcv_host_len); + + if (setsockopt (sock, SOL_TCP, TCP_HOSTS, &hosti, sizeof (struct host_info)) < 0) { + // TODO: failure condition + } /* Connect the socket to the remote host. */ if (connect (sock, (struct sockaddr *)&sock_name, sizeof (sock_name)) < 0)