-#include "config.h"
+#include "squid.h"
/*
* On some systems, FD_SETSIZE is set to something lower than the
#define CHANGE_FD_SETSIZE 1
/* Cannot increase FD_SETSIZE on Linux */
-#if defined(_SQUID_LINUX_)
+#if _SQUID_LINUX_
#undef CHANGE_FD_SETSIZE
#define CHANGE_FD_SETSIZE 0
#endif
* to return EINVAL. */
/* Marian Durkovic <marian@svf.stuba.sk> */
/* Peter Wemm <peter@spinner.DIALix.COM> */
-#if defined(_SQUID_FREEBSD_)
+#if _SQUID_FREEBSD_
#include <osreldate.h>
#if __FreeBSD_version < 220000
#undef CHANGE_FD_SETSIZE
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_STDIO_H
#include <stdio.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef HAVE_STRING_H
+#if HAVE_STRING_H
#include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
+#if HAVE_STRINGS_H
#include <strings.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
#if HAVE_SIGNAL_H
#include <signal.h>
#endif
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if HAVE_ASSERT_H
#include <assert.h>
#endif
+#if HAVE_NETDB_H
#include <netdb.h>
+#endif
+#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
+#endif
#define READ_BUF_SZ 4096
#define URL_BUF_SZ 4096
memcpy(&S.sin_addr.s_addr, h->h_addr_list[0], sizeof(S.sin_addr.s_addr));
S.sin_port = htons(port);
S.sin_family = AF_INET;
- if (debug)
- fprintf(stderr, "%s (%s) %d %s\n", host, inet_ntoa(S.sin_addr), (int) port, path);
+ if (debug) {
+ char tmp[16];
+ fprintf(stderr, "%s (%s) %d %s\n", host, inet_ntop(AF_INET, &S.sin_addr,tmp,sizeof(tmp)), (int) port, path);
+ }
s = socket(PF_INET, SOCK_STREAM, 0);
if (s < 0) {
perror("socket");
signal(sig, sig_child);
}
-
int
main(int argc, char *argv[])
{