-# From configure.in Revision: 1.27
+# From configure.in Revision: 1.28
ac_aux_dir=
for ac_dir in aux $srcdir/aux; do
if test -f $ac_dir/install-sh; then
rm -f conftest*
+echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6
+cat > conftest.$ac_ext <<EOF
+#line 2474 "configure"
+#include "confdefs.h"
+extern int _dns_ttl_;
+int main() { return 0; }
+int t() {
+return _dns_ttl_;
+; return 0; }
+EOF
+if eval $ac_link; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+cat >> confdefs.h <<\EOF
+#define LIBRESOLV_DNS_TTL_HACK 1
+EOF
+
+else
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+
XTRA_OBJS=''
if test "$HAVE_LIBMALLOC" = "yes" ; then
if test -r /usr/lib/debug/malloc.o ; then
dnl
dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
dnl
-dnl $Id: configure.in,v 1.28 1996/08/27 18:01:34 wessels Exp $
+dnl $Id: configure.in,v 1.29 1996/08/27 20:10:47 wessels Exp $
dnl
dnl
dnl
AC_INIT(src/main.c)
AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.28 $)dnl
+AC_REVISION($Revision: 1.29 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AC_CONFIG_AUX_DIR(aux)
[AC_MSG_RESULT(no)
AC_DEFINE(NEED_SYS_ERRLIST)])
+AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
+AC_TRY_LINK(extern int _dns_ttl_;,return _dns_ttl_;,
+[AC_MSG_RESULT(yes)
+AC_DEFINE(LIBRESOLV_DNS_TTL_HACK)],
+AC_MSG_RESULT(no))
+
dnl Need the debugging version of malloc if available
XTRA_OBJS=''
if test "$HAVE_LIBMALLOC" = "yes" ; then
/* If gettimeofday is known to take only one argument */
#undef GETTIMEOFDAY_NO_TZP
+/* If libresolv.a has been hacked to export _dns_ttl_ */
+#undef LIBRESOLV_DNS_TTL_HACK
+
/* The number of bytes in a int. */
#undef SIZEOF_INT
/*
- * $Id: dnsserver.cc,v 1.13 1996/08/26 19:57:04 wessels Exp $
+ * $Id: dnsserver.cc,v 1.14 1996/08/27 20:10:51 wessels Exp $
*
* DEBUG: section 0 DNS Resolver
* AUTHOR: Harvest Derived
extern int h_errno;
+#if LIBRESOLV_DNS_TTL_HACK
+extern int _dns_ttl_; /* this is a really *dirty* hack - bne */
+#endif
+
int do_debug = 0;
/* error messages from gethostbyname() */
printf("%s\n", result->h_aliases[i]);
}
+#if LIBRESOLV_DNS_TTL_HACK
+ /* DNS TTL handling - bne@CareNet.hu
+ * for first try it's a dirty hack, by hacking getanswer
+ * to place th e ttl in a global variable */
+ printf("$ttl %d\n", _dns_ttl_);
+#endif
+
printf("$end\n");
fflush(stdout);
continue;
/*
- * $Id: ipcache.cc,v 1.44 1996/08/27 05:19:09 wessels Exp $
+ * $Id: ipcache.cc,v 1.45 1996/08/27 20:10:52 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
k++;
}
}
+ /* DNS TTL - bne@CareNet.hu */
+ /* next line is either a $ttl ttl\n or a $end\n */
+ if (strstr(line_cur->line, "$ttl")) {
+ tmp_ptr = line_cur->line;
+ /* skip the first token */
+ token = strtok(tmp_ptr, w_space);
+ tmp_ptr = NULL;
+ token = strtok(tmp_ptr, w_space);
+ i->expires = squid_curtime + atoi(token);
+ }
ipcache_call_pending(i);
debug(14, 10, "ipcache_parsebuffer: $name succeeded.\n");
}