error compiling squid-1.0.9

From: Edward Henigin <ed@dont-contact.us>
Date: Thu, 22 Aug 1996 15:37:34 -0500 (CDT)

        solaris 2.5.1, gcc 2.7.2, same platform has successfully
compiled squid 1.0.5 through 1.0.8.

        I'm guessing that one solution is to #define INADDR_NONE
to -1 in config.h?

make[1]: Entering directory `/usr/local/src/squid-1.0.9/src'
gcc -g -O -Wall -I. -I../include -I./../include -c ftpget.c
ftpget.c: In function `parse_request':
ftpget.c:1196: `INADDR_NONE' undeclared (first use this function)
ftpget.c:1196: (Each undeclared identifier is reported only once
ftpget.c:1196: for each function it appears in.)
make[1]: *** [ftpget.o] Error 1
make[1]: Leaving directory `/usr/local/src/squid-1.0.9/src'
make: *** [all] Error 2

        excerpt from diff -c, which I believe is where the problem is:

*** squid-1.0.8/src/ftpget.c Mon Aug 19 14:44:17 1996
--- squid-1.0.9/src/ftpget.c Thu Aug 22 15:32:19 1996
***************
*** 1186,1198 ****
  state_t parse_request(r)
       request_t *r;
  {
      Debug(26, 1, ("parse_request: looking up '%s'\n", r->host));
! if (get_host(r->host) == NULL) {
        r->errmsg = xmalloc(SMALLBUFSIZ);
        sprintf(r->errmsg, "Unknown host: %s", r->host);
        r->rc = 10;
        return FAIL_HARD;
      }
      return PARSE_OK;
  }

--- 1189,1208 ----
  state_t parse_request(r)
       request_t *r;
  {
+ struct hostent *hp;
      Debug(26, 1, ("parse_request: looking up '%s'\n", r->host));
!
! r->host_addr.s_addr = inet_addr(r->host); /* try numeric */
! if (r->host_addr.s_addr != INADDR_NONE)
! return PARSE_OK;
! hp = gethostbyname(r->host);
! if (hp == NULL) {
        r->errmsg = xmalloc(SMALLBUFSIZ);
        sprintf(r->errmsg, "Unknown host: %s", r->host);
        r->rc = 10;
        return FAIL_HARD;
      }
+ xmemcpy(&r->host_addr.s_addr, *hp->h_addr_list, 4);
      return PARSE_OK;
  }
Received on Thu Aug 22 1996 - 13:39:11 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:32:50 MST