-diff -Nur apache_1.3.23.orig/README.v6 apache_1.3.23/README.v6
---- apache_1.3.23.orig/README.v6 Thu Jan 1 01:00:00 1970
-+++ apache_1.3.23/README.v6 Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/README.v6 apache_1.3.26/README.v6
+--- apache_1.3.26.orig/README.v6 Thu Jan 1 01:00:00 1970
++++ apache_1.3.26/README.v6 Wed Jun 19 10:26:32 2002
@@ -0,0 +1,166 @@
+IPv6-ready apache 1.3.x
+KAME Project
+ http://www.v6.linux.or.jp/
+ YOSHIFUJI Hideaki, USAGI Project
+ http://www.linux-ipv6.org/
-diff -Nur apache_1.3.23.orig/conf/httpd.conf-dist apache_1.3.23/conf/httpd.conf-dist
---- apache_1.3.23.orig/conf/httpd.conf-dist Wed Jan 9 17:05:31 2002
-+++ apache_1.3.23/conf/httpd.conf-dist Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/conf/httpd.conf-dist apache_1.3.26/conf/httpd.conf-dist
+--- apache_1.3.26.orig/conf/httpd.conf-dist Tue Mar 5 17:19:12 2002
++++ apache_1.3.26/conf/httpd.conf-dist Wed Jun 19 10:26:32 2002
@@ -174,6 +174,11 @@
#Listen 3000
#Listen 12.34.56.78:80
#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
-diff -Nur apache_1.3.23.orig/configure.v6 apache_1.3.23/configure.v6
---- apache_1.3.23.orig/configure.v6 Thu Jan 1 01:00:00 1970
-+++ apache_1.3.23/configure.v6 Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/configure.v6 apache_1.3.26/configure.v6
+--- apache_1.3.26.orig/configure.v6 Thu Jan 1 01:00:00 1970
++++ apache_1.3.26/configure.v6 Wed Jun 19 10:26:32 2002
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+./configure --enable-rule=INET6 --enable-module=proxy $*
-diff -Nur apache_1.3.23.orig/src/Configuration.tmpl apache_1.3.23/src/Configuration.tmpl
---- apache_1.3.23.orig/src/Configuration.tmpl Wed Feb 6 20:17:43 2002
-+++ apache_1.3.23/src/Configuration.tmpl Wed Feb 6 20:21:56 2002
+diff -Nur apache_1.3.26.orig/src/Configuration.tmpl apache_1.3.26/src/Configuration.tmpl
+--- apache_1.3.26.orig/src/Configuration.tmpl Wed Jun 19 10:25:56 2002
++++ apache_1.3.26/src/Configuration.tmpl Wed Jun 19 10:26:32 2002
@@ -191,6 +191,9 @@
# Rule EXPAT=default : If Expat can be found at the system or
# in lib/expat-lite, use it; otherwise
Rule CYGWIN_WINSOCK=no
# DEV_RANDOM:
-diff -Nur apache_1.3.23.orig/src/Configure apache_1.3.23/src/Configure
---- apache_1.3.23.orig/src/Configure Wed Feb 6 20:17:43 2002
-+++ apache_1.3.23/src/Configure Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/Configure apache_1.3.26/src/Configure
+--- apache_1.3.26.orig/src/Configure Wed Jun 19 10:25:56 2002
++++ apache_1.3.26/src/Configure Wed Jun 19 10:26:32 2002
@@ -238,6 +238,7 @@
RULE_CYGWIN_WINSOCK=`./helpers/CutRule CYGWIN_WINSOCK $file`
RULE_SHARED_CORE=`./helpers/CutRule SHARED_CORE $file`
####################################################################
## Rule SHARED_CORE implies required DSO support
-@@ -1698,6 +1699,124 @@
+@@ -1701,6 +1702,124 @@
esac
fi
####################################################################
## Find out what modules we want and try and configure things for them
## Module lines can look like this:
-@@ -2293,6 +2412,38 @@
+@@ -2296,6 +2415,38 @@
echo "#define AP_LONGEST_LONG $AP_LONGEST_LONG" >>$AP_CONFIG_AUTO_H
echo "#endif" >>$AP_CONFIG_AUTO_H
####################################################################
## More building ap_config_auto.h
##
-diff -Nur apache_1.3.23.orig/src/ap/ap_snprintf.c apache_1.3.23/src/ap/ap_snprintf.c
---- apache_1.3.23.orig/src/ap/ap_snprintf.c Mon Jan 21 22:56:43 2002
-+++ apache_1.3.23/src/ap/ap_snprintf.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/ap/ap_snprintf.c apache_1.3.26/src/ap/ap_snprintf.c
+--- apache_1.3.26.orig/src/ap/ap_snprintf.c Thu Mar 14 13:08:06 2002
++++ apache_1.3.26/src/ap/ap_snprintf.c Wed Jun 19 10:26:32 2002
@@ -73,6 +73,7 @@
#include <string.h>
#include <stdlib.h>
else {
s = S_NULL;
s_len = S_NULL_LEN;
-diff -Nur apache_1.3.23.orig/src/include/ap.h apache_1.3.23/src/include/ap.h
---- apache_1.3.23.orig/src/include/ap.h Mon Jan 21 22:56:43 2002
-+++ apache_1.3.23/src/include/ap.h Wed Feb 6 20:20:48 2002
-@@ -91,7 +91,8 @@
+diff -Nur apache_1.3.26.orig/src/include/ap.h apache_1.3.26/src/include/ap.h
+--- apache_1.3.26.orig/src/include/ap.h Tue Jun 18 06:19:45 2002
++++ apache_1.3.26/src/include/ap.h Wed Jun 19 10:26:32 2002
+@@ -95,7 +95,8 @@
* with some extensions. The extensions are:
*
* %pA takes a struct in_addr *, and prints it as a.b.c.d
* %pp takes a void * and outputs it in hex
*
* The %p hacks are to force gcc's printf warning code to skip
-diff -Nur apache_1.3.23.orig/src/include/ap_config.h apache_1.3.23/src/include/ap_config.h
---- apache_1.3.23.orig/src/include/ap_config.h Thu Jan 17 14:20:51 2002
-+++ apache_1.3.23/src/include/ap_config.h Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/include/ap_config.h apache_1.3.26/src/include/ap_config.h
+--- apache_1.3.26.orig/src/include/ap_config.h Mon Jun 3 14:28:27 2002
++++ apache_1.3.26/src/include/ap_config.h Wed Jun 19 10:26:32 2002
@@ -407,6 +407,10 @@
#endif
#ifndef S_IWOTH
#endif
#define STDIN_FILENO 0
-@@ -1507,6 +1511,70 @@
+@@ -1509,6 +1513,70 @@
#define ap_wait_t int
#endif
#ifdef __cplusplus
}
#endif
-diff -Nur apache_1.3.23.orig/src/include/http_conf_globals.h apache_1.3.23/src/include/http_conf_globals.h
---- apache_1.3.23.orig/src/include/http_conf_globals.h Wed Feb 6 20:17:43 2002
-+++ apache_1.3.23/src/include/http_conf_globals.h Wed Feb 6 20:23:09 2002
+diff -Nur apache_1.3.26.orig/src/include/http_conf_globals.h apache_1.3.26/src/include/http_conf_globals.h
+--- apache_1.3.26.orig/src/include/http_conf_globals.h Wed Jun 19 10:25:56 2002
++++ apache_1.3.26/src/include/http_conf_globals.h Wed Jun 19 10:26:32 2002
@@ -82,7 +82,8 @@
extern API_VAR_EXPORT int ap_max_requests_per_child;
extern API_VAR_EXPORT int ap_threads_per_child;
extern listen_rec *ap_listeners;
extern API_VAR_EXPORT int ap_daemons_to_start;
extern API_VAR_EXPORT int ap_daemons_min_free;
-diff -Nur apache_1.3.23.orig/src/include/http_vhost.h apache_1.3.23/src/include/http_vhost.h
---- apache_1.3.23.orig/src/include/http_vhost.h Mon Jan 21 00:13:51 2002
-+++ apache_1.3.23/src/include/http_vhost.h Wed Feb 6 20:23:58 2002
+diff -Nur apache_1.3.26.orig/src/include/http_vhost.h apache_1.3.26/src/include/http_vhost.h
+--- apache_1.3.26.orig/src/include/http_vhost.h Wed Mar 13 22:05:29 2002
++++ apache_1.3.26/src/include/http_vhost.h Wed Jun 19 10:26:32 2002
@@ -73,7 +73,7 @@
API_EXPORT(const char *) ap_parse_vhost_addrs(pool *p, const char *hostname, server_rec *s);
/* given an ip address only, give our best guess as to what vhost it is */
API_EXPORT(void) ap_update_vhost_given_ip(conn_rec *conn);
-diff -Nur apache_1.3.23.orig/src/include/httpd.h apache_1.3.23/src/include/httpd.h
---- apache_1.3.23.orig/src/include/httpd.h Wed Feb 6 20:17:43 2002
-+++ apache_1.3.23/src/include/httpd.h Wed Feb 6 20:24:49 2002
-@@ -912,8 +912,8 @@
+diff -Nur apache_1.3.26.orig/src/include/httpd.h apache_1.3.26/src/include/httpd.h
+--- apache_1.3.26.orig/src/include/httpd.h Wed Jun 19 10:25:56 2002
++++ apache_1.3.26/src/include/httpd.h Wed Jun 19 10:26:32 2002
+@@ -903,8 +903,8 @@
/* Who is the client? */
char *remote_ip; /* Client's IP address */
char *remote_host; /* Client's DNS name, if known.
* NULL if DNS hasn't been checked,
-@@ -955,8 +955,8 @@
+@@ -946,8 +946,8 @@
typedef struct server_addr_rec server_addr_rec;
struct server_addr_rec {
server_addr_rec *next;
char *virthost; /* The name given in <VirtualHost> */
};
-@@ -1024,7 +1024,7 @@
+@@ -1015,7 +1015,7 @@
/* These are more like real hosts than virtual hosts */
struct listen_rec {
listen_rec *next;
int fd;
int used; /* Only used during restart */
/* more stuff here, like which protocol is bound to the port */
-@@ -1184,7 +1184,7 @@
+@@ -1183,7 +1183,7 @@
#endif /*#ifdef CHARSET_EBCDIC*/
API_EXPORT(char *) ap_get_local_host(pool *);
extern API_VAR_EXPORT time_t ap_restart_time;
-diff -Nur apache_1.3.23.orig/src/include/sa_len.h apache_1.3.23/src/include/sa_len.h
---- apache_1.3.23.orig/src/include/sa_len.h Thu Jan 1 01:00:00 1970
-+++ apache_1.3.23/src/include/sa_len.h Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/include/sa_len.h apache_1.3.26/src/include/sa_len.h
+--- apache_1.3.26.orig/src/include/sa_len.h Thu Jan 1 01:00:00 1970
++++ apache_1.3.26/src/include/sa_len.h Wed Jun 19 10:26:32 2002
@@ -0,0 +1,41 @@
+/* sa_len.h : tiny version of SA_LEN (written by <yoshfuji@ecei.tohoku.ac.jp>) */
+
+}
+#endif /* SA_LEN */
+#endif /* HAVE_SOCKADDR_LEN */
-diff -Nur apache_1.3.23.orig/src/include/sockaddr_storage.h apache_1.3.23/src/include/sockaddr_storage.h
---- apache_1.3.23.orig/src/include/sockaddr_storage.h Thu Jan 1 01:00:00 1970
-+++ apache_1.3.23/src/include/sockaddr_storage.h Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/include/sockaddr_storage.h apache_1.3.26/src/include/sockaddr_storage.h
+--- apache_1.3.26.orig/src/include/sockaddr_storage.h Thu Jan 1 01:00:00 1970
++++ apache_1.3.26/src/include/sockaddr_storage.h Wed Jun 19 10:26:32 2002
@@ -0,0 +1,53 @@
+/*
+struct sockaddr_storage
+#define su_port su_si.si_port
+
+#endif /* NEED_SOCKADDR_STORAGE */
-diff -Nur apache_1.3.23.orig/src/main/getaddrinfo.c apache_1.3.23/src/main/getaddrinfo.c
---- apache_1.3.23.orig/src/main/getaddrinfo.c Thu Jan 1 01:00:00 1970
-+++ apache_1.3.23/src/main/getaddrinfo.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/main/getaddrinfo.c apache_1.3.26/src/main/getaddrinfo.c
+--- apache_1.3.26.orig/src/main/getaddrinfo.c Thu Jan 1 01:00:00 1970
++++ apache_1.3.26/src/main/getaddrinfo.c Wed Jun 19 10:26:32 2002
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
+ }
+ return EAI_NODATA;
+}
-diff -Nur apache_1.3.23.orig/src/main/getnameinfo.c apache_1.3.23/src/main/getnameinfo.c
---- apache_1.3.23.orig/src/main/getnameinfo.c Thu Jan 1 01:00:00 1970
-+++ apache_1.3.23/src/main/getnameinfo.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/main/getnameinfo.c apache_1.3.26/src/main/getnameinfo.c
+--- apache_1.3.26.orig/src/main/getnameinfo.c Thu Jan 1 01:00:00 1970
++++ apache_1.3.26/src/main/getnameinfo.c Wed Jun 19 10:26:32 2002
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
+ return EAI_NODATA;
+ return 0;
+}
-diff -Nur apache_1.3.23.orig/src/main/http_config.c apache_1.3.23/src/main/http_config.c
---- apache_1.3.23.orig/src/main/http_config.c Wed Feb 6 20:17:43 2002
-+++ apache_1.3.23/src/main/http_config.c Wed Feb 6 20:28:01 2002
+diff -Nur apache_1.3.26.orig/src/main/http_config.c apache_1.3.26/src/main/http_config.c
+--- apache_1.3.26.orig/src/main/http_config.c Wed Jun 19 10:25:56 2002
++++ apache_1.3.26/src/main/http_config.c Wed Jun 19 10:26:32 2002
@@ -1564,7 +1564,6 @@
ap_scoreboard_fname = DEFAULT_SCOREBOARD;
ap_lock_fname = DEFAULT_LOCKFILE;
}
-diff -Nur apache_1.3.23.orig/src/main/http_core.c apache_1.3.23/src/main/http_core.c
---- apache_1.3.23.orig/src/main/http_core.c Wed Jan 16 22:34:32 2002
-+++ apache_1.3.23/src/main/http_core.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/main/http_core.c apache_1.3.26/src/main/http_core.c
+--- apache_1.3.26.orig/src/main/http_core.c Tue Jun 18 02:59:57 2002
++++ apache_1.3.26/src/main/http_core.c Wed Jun 19 10:26:32 2002
@@ -71,6 +71,7 @@
#include "util_md5.h"
#include "scoreboard.h"
#ifdef USE_MMAP_FILES
#include <sys/mman.h>
-@@ -621,7 +622,9 @@
- /* Code from Harald Hanche-Olsen <hanche@imf.unit.no> */
+@@ -638,7 +639,9 @@
+ */
static ap_inline void do_double_reverse (conn_rec *conn)
{
- struct hostent *hptr;
if (conn->double_reverse) {
/* already done */
-@@ -632,28 +635,51 @@
- conn->double_reverse = -1;
+@@ -650,19 +653,43 @@
+ conn->remote_host = ""; /* prevent another lookup */
return;
}
- hptr = gethostbyname(conn->remote_host);
- conn->double_reverse = -1;
+ conn->double_reverse = ok ? 1 : -1;
+ freeaddrinfo(res0);
+ /* invalidate possible reverse-resolved hostname if forward lookup fails */
+ conn->remote_host = "";
}
-
+@@ -670,10 +697,9 @@
API_EXPORT(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config,
int type)
{
/* If we haven't checked the host name, and we want to */
if (dir_config) {
-@@ -675,10 +701,14 @@
+@@ -695,10 +721,14 @@
|| hostname_lookups != HOSTNAME_LOOKUP_OFF)) {
old_stat = ap_update_child_status(conn->child_num, SERVER_BUSY_DNS,
(request_rec*)NULL);
ap_str_tolower(conn->remote_host);
if (hostname_lookups == HOSTNAME_LOOKUP_DOUBLE) {
-@@ -759,6 +789,7 @@
+@@ -776,6 +806,7 @@
{
conn_rec *conn = r->connection;
core_dir_config *d;
d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
&core_module);
-@@ -768,23 +799,22 @@
+@@ -785,23 +816,22 @@
}
if (d->use_canonical_name == USE_CANONICAL_NAME_DNS) {
if (conn->local_host == NULL) {
(void) ap_update_child_status(conn->child_num, old_stat, r);
}
return conn->local_host;
-@@ -803,11 +833,13 @@
+@@ -820,11 +850,13 @@
if (d->use_canonical_name == USE_CANONICAL_NAME_OFF
|| d->use_canonical_name == USE_CANONICAL_NAME_DNS) {
}
API_EXPORT(char *) ap_construct_url(pool *p, const char *uri,
-@@ -2539,12 +2571,25 @@
+@@ -2556,12 +2588,25 @@
static const char *set_bind_address(cmd_parms *cmd, void *dummy, char *arg)
{
return NULL;
}
-@@ -2576,44 +2621,70 @@
+@@ -2593,44 +2638,70 @@
return NULL;
}
new->fd = -1;
new->used = 0;
new->next = ap_listeners;
-@@ -3328,7 +3399,7 @@
+@@ -3353,7 +3424,7 @@
{ "ThreadStackSize", set_threadstacksize, NULL, RSRC_CONF, TAKE1,
"Stack size each created thread will use."},
#endif
"A port number or a numeric IP address and a port number"},
{ "SendBufferSize", set_send_buffer_size, NULL, RSRC_CONF, TAKE1,
"Send buffer size in bytes"},
-@@ -3362,7 +3433,7 @@
+@@ -3387,7 +3458,7 @@
"Name of the config file to be included" },
{ "LogLevel", set_loglevel, NULL, RSRC_CONF, TAKE1,
"Level of verbosity in error logging" },
"A numeric IP address:port, or the name of a host" },
#ifdef _OSD_POSIX
{ "BS2000Account", set_bs2000_account, NULL, RSRC_CONF, TAKE1,
-diff -Nur apache_1.3.23.orig/src/main/http_main.c apache_1.3.23/src/main/http_main.c
---- apache_1.3.23.orig/src/main/http_main.c Wed Feb 6 20:17:43 2002
-+++ apache_1.3.23/src/main/http_main.c Wed Feb 6 20:29:52 2002
+diff -Nur apache_1.3.26.orig/src/main/http_main.c apache_1.3.26/src/main/http_main.c
+--- apache_1.3.26.orig/src/main/http_main.c Wed Jun 19 10:25:56 2002
++++ apache_1.3.26/src/main/http_main.c Wed Jun 19 10:30:52 2002
@@ -124,6 +124,8 @@
#include <bstring.h> /* for IRIX, FD_SET calls bzero() */
#endif
API_VAR_EXPORT int ap_daemons_to_start=0;
API_VAR_EXPORT int ap_daemons_min_free=0;
API_VAR_EXPORT int ap_daemons_max_free=0;
-@@ -1384,7 +1391,11 @@
+@@ -1389,7 +1396,11 @@
fprintf(stderr, "Usage: %s [-D name] [-d directory] [-f file]\n", bin);
#endif
fprintf(stderr, " %s [-C \"directive\"] [-c \"directive\"]\n", pad);
-- fprintf(stderr, " %s [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T]\n", pad);
-+ fprintf(stderr, " %s [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T]"
+- fprintf(stderr, " %s [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T] [-F]\n", pad);
++ fprintf(stderr, " %s [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T] [-F]"
+#ifdef INET6
+ " [-46]"
+#endif
fprintf(stderr, "Options:\n");
#ifdef SHARED_CORE
fprintf(stderr, " -R directory : specify an alternate location for shared object files\n");
-@@ -1406,6 +1417,10 @@
+@@ -1415,6 +1426,10 @@
+ #ifndef WIN32
+ fprintf(stderr, " -F : run main process in foreground, for process supervisors\n");
#endif
- fprintf(stderr, " -t : run syntax check for config files (with docroot check)\n");
- fprintf(stderr, " -T : run syntax check for config files (without docroot check)\n");
+#ifdef INET6
+ fprintf(stderr, " -4 : assume IPv4 on parsing configuration file\n");
+ fprintf(stderr, " -6 : assume IPv6 on parsing configuration file\n");
#ifdef WIN32
fprintf(stderr, " -n name : name the Apache service for -k options below;\n");
fprintf(stderr, " -k stop|shutdown : tell running Apache to shutdown\n");
-@@ -3566,11 +3581,13 @@
+@@ -3592,11 +3607,13 @@
static conn_rec *new_connection(pool *p, server_rec *server, BUFF *inout,
/* Got a connection structure, so initialize what fields we can
* (the rest are zeroed out by pcalloc).
-@@ -3579,17 +3596,29 @@
+@@ -3605,17 +3622,29 @@
conn->child_num = child_num;
conn->pool = p;
#ifdef EAPI
conn->ctx = ap_ctx_new(conn->pool);
#endif /* EAPI */
-@@ -3640,21 +3669,47 @@
+@@ -3666,21 +3695,47 @@
#define sock_disable_nagle(s) /* NOOP */
#endif
ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf,
"make_sock: failed to get a socket for %s", addr);
-@@ -3757,15 +3812,19 @@
+@@ -3783,15 +3838,19 @@
#ifdef MPE
/* MPE requires CAP=PM and GETPRIVMODE to bind to ports less than 1024 */
GETUSERMODE();
#endif
-@@ -3778,7 +3837,7 @@
+@@ -3804,7 +3863,7 @@
exit(1);
}
#ifdef MPE
GETUSERMODE();
#endif
-@@ -3931,15 +3990,17 @@
+@@ -3957,15 +4016,17 @@
for (;;) {
fd = find_listener(lr);
if (fd < 0) {
lr->fd = fd;
if (lr->next == NULL)
break;
-@@ -4257,8 +4318,8 @@
+@@ -4280,8 +4341,8 @@
static void child_main(int child_num_arg)
{
NET_SIZE_T clen;
listen_rec *lr;
/* All of initialization is a critical section, we don't care if we're
-@@ -4423,7 +4484,7 @@
+@@ -4453,7 +4514,7 @@
usr1_just_die = 0;
for (;;) {
clen = sizeof(sa_client);
if (csd >= 0 || errno != EINTR)
break;
if (deferred_die) {
-@@ -4586,7 +4647,7 @@
+@@ -4616,7 +4677,7 @@
*/
clen = sizeof(sa_server);
ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "getsockname");
continue;
}
-@@ -4631,8 +4692,8 @@
+@@ -4661,8 +4722,8 @@
ap_bpushfd(conn_io, csd, dupped_csd);
current_conn = new_connection(ptrans, server_conf, conn_io,
my_child_num);
/*
-@@ -4776,12 +4837,13 @@
+@@ -4817,12 +4878,13 @@
#ifdef _OSD_POSIX
/* BS2000 requires a "special" version of fork() before a setuid() call */
ap_log_error(APLOG_MARK, APLOG_ERR, s, "fork: Unable to fork new process");
/* fork didn't succeed. Fix the scoreboard or else
-@@ -5390,7 +5452,10 @@
+@@ -5434,7 +5496,10 @@
ap_setup_prelinked_modules();
while ((c = getopt(argc, argv,
-- "D:C:c:xXd:f:vVlLR:StTh"
-+ "D:C:c:xXd:f:vVlLR:StTh4"
+- "D:C:c:xXd:Ff:vVlLR:StTh"
++ "D:C:c:xXd:Ff:vVlLR:StTh4"
+#ifdef INET6
+ "6"
+#endif
#ifdef DEBUG_SIGSTOP
"Z:"
#endif
-@@ -5465,8 +5530,14 @@
+@@ -5512,8 +5577,14 @@
ap_configtestonly = 1;
ap_docrootcheck = 0;
break;
case '?':
usage(argv[0]);
}
-@@ -5546,9 +5617,10 @@
+@@ -5601,9 +5672,10 @@
else {
conn_rec *conn;
request_rec *r;
ap_set_version();
/* Yes this is called twice. */
-@@ -5595,25 +5667,32 @@
+@@ -5658,25 +5730,32 @@
#endif
l = sizeof(sa_client);
while ((r = ap_read_request(conn)) != NULL) {
-@@ -7820,7 +7899,11 @@
- * but only handle the -L option
- */
- llp_dir = SHARED_CORE_DIR;
-- while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:SZ:tTh")) != -1) {
-+ while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:SZ:tTh4"
+@@ -7383,7 +7462,11 @@
+
+ while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLz:Z:wiuStThk:n:W:")) != -1) {
+ #else /* !WIN32 */
+- while ((c = getopt(argc, argv, "D:C:c:Xd:fF:vVlLesStTh")) != -1) {
++ while ((c = getopt(argc, argv, "D:C:c:Xd:fF:vVlLesStTh4"
+#ifdef INET6
+ "6"
+#endif
+ )) != -1) {
+ #endif
+ char **new;
switch (c) {
- case 'D':
- case 'C':
-@@ -7837,6 +7920,10 @@
+@@ -7929,6 +8012,10 @@
case 't':
case 'T':
case 'h':
case '?':
break;
case 'R':
-diff -Nur apache_1.3.23.orig/src/main/http_vhost.c apache_1.3.23/src/main/http_vhost.c
---- apache_1.3.23.orig/src/main/http_vhost.c Mon Jan 21 00:13:51 2002
-+++ apache_1.3.23/src/main/http_vhost.c Wed Feb 6 20:30:51 2002
+diff -Nur apache_1.3.26.orig/src/main/http_vhost.c apache_1.3.26/src/main/http_vhost.c
+--- apache_1.3.26.orig/src/main/http_vhost.c Wed Mar 13 22:05:31 2002
++++ apache_1.3.26/src/main/http_vhost.c Wed Jun 19 10:26:32 2002
@@ -68,6 +68,7 @@
#include "http_log.h"
#include "http_vhost.h"
/* otherwise we're stuck with just the main server
* and no name-based vhosts
*/
-diff -Nur apache_1.3.23.orig/src/main/rfc1413.c apache_1.3.23/src/main/rfc1413.c
---- apache_1.3.23.orig/src/main/rfc1413.c Sun Jan 20 21:14:37 2002
-+++ apache_1.3.23/src/main/rfc1413.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/main/rfc1413.c apache_1.3.26/src/main/rfc1413.c
+--- apache_1.3.26.orig/src/main/rfc1413.c Wed Mar 13 22:05:31 2002
++++ apache_1.3.26/src/main/rfc1413.c Wed Jun 19 10:26:32 2002
@@ -82,6 +82,7 @@
#include "http_log.h" /* for aplog_error */
#include "rfc1413.h"
}
ap_set_callback_and_alarm(NULL, 0);
ap_pclosesocket(conn->pool, sock);
-diff -Nur apache_1.3.23.orig/src/main/util.c apache_1.3.23/src/main/util.c
---- apache_1.3.23.orig/src/main/util.c Fri Dec 28 06:03:07 2001
-+++ apache_1.3.23/src/main/util.c Wed Feb 6 20:36:21 2002
-@@ -1962,52 +1962,87 @@
+diff -Nur apache_1.3.26.orig/src/main/util.c apache_1.3.26/src/main/util.c
+--- apache_1.3.26.orig/src/main/util.c Tue Jun 18 02:59:58 2002
++++ apache_1.3.26/src/main/util.c Wed Jun 19 10:26:32 2002
+@@ -2017,52 +2017,87 @@
* Parses a host of the form <address>[:port]
* :port is permitted if 'port' is not NULL
*/
}
-@@ -2035,7 +2070,8 @@
+@@ -2090,7 +2125,8 @@
#endif
char str[MAXHOSTNAMELEN];
char *server_hostname = NULL;
#ifdef BEOS /* BeOS returns zero as an error for gethostname */
if (gethostname(str, sizeof(str) - 1) == 0) {
-@@ -2048,29 +2084,38 @@
+@@ -2103,29 +2139,38 @@
}
else
{
return server_hostname;
}
-@@ -2149,7 +2194,7 @@
- char *quote_doubled_str, *dest;
-
- while (str[len]) {
-- num_quotes += str[len++] == '\"';
-+ num_quotes += str[len++] == '\"';
- }
-
- quote_doubled_str = ap_palloc(p, len + num_quotes + 1);
-@@ -2274,3 +2319,11 @@
+@@ -2369,3 +2414,11 @@
}
*dest = 0;
}
+#ifdef NEED_GETNAMEINFO
+#include "getnameinfo.c"
+#endif
-diff -Nur apache_1.3.23.orig/src/main/util_script.c apache_1.3.23/src/main/util_script.c
---- apache_1.3.23.orig/src/main/util_script.c Fri Oct 12 01:37:39 2001
-+++ apache_1.3.23/src/main/util_script.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/main/util_script.c apache_1.3.26/src/main/util_script.c
+--- apache_1.3.26.orig/src/main/util_script.c Thu Mar 21 17:07:02 2002
++++ apache_1.3.26/src/main/util_script.c Wed Jun 19 10:26:32 2002
@@ -67,6 +67,7 @@
#include "http_request.h" /* for sub_req_lookup_uri() */
#include "util_script.h"
#ifdef OS2
#define INCL_DOS
-@@ -208,6 +209,7 @@
+@@ -203,6 +204,7 @@
array_header *hdrs_arr = ap_table_elts(r->headers_in);
table_entry *hdrs = (table_entry *) hdrs_arr->elts;
int i;
/* use a temporary table which we'll overlap onto
* r->subprocess_env later
-@@ -298,8 +300,16 @@
+@@ -293,8 +295,16 @@
ap_table_addn(e, "SERVER_ADMIN", s->server_admin); /* Apache */
ap_table_addn(e, "SCRIPT_FILENAME", r->filename); /* Apache */
if (c->user) {
ap_table_addn(e, "REMOTE_USER", c->user);
-diff -Nur apache_1.3.23.orig/src/main/util_uri.c apache_1.3.23/src/main/util_uri.c
---- apache_1.3.23.orig/src/main/util_uri.c Sun Jan 20 21:14:37 2002
-+++ apache_1.3.23/src/main/util_uri.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/main/util_uri.c apache_1.3.26/src/main/util_uri.c
+--- apache_1.3.26.orig/src/main/util_uri.c Tue Jun 18 02:59:58 2002
++++ apache_1.3.26/src/main/util_uri.c Wed Jun 19 10:26:32 2002
@@ -419,6 +419,12 @@
* the hostname. If there's a port it is the first colon.
*/
if (s == NULL) {
return HTTP_BAD_REQUEST;
}
-diff -Nur apache_1.3.23.orig/src/modules/proxy/mod_proxy.c apache_1.3.23/src/modules/proxy/mod_proxy.c
---- apache_1.3.23.orig/src/modules/proxy/mod_proxy.c Wed Feb 6 20:17:43 2002
-+++ apache_1.3.23/src/modules/proxy/mod_proxy.c Wed Feb 6 20:38:49 2002
-@@ -556,11 +556,31 @@
+diff -Nur apache_1.3.26.orig/src/modules/proxy/mod_proxy.c apache_1.3.26/src/modules/proxy/mod_proxy.c
+--- apache_1.3.26.orig/src/modules/proxy/mod_proxy.c Wed Jun 19 10:25:56 2002
++++ apache_1.3.26/src/modules/proxy/mod_proxy.c Wed Jun 19 10:32:29 2002
+@@ -574,11 +574,31 @@
struct proxy_remote *new;
char *p, *q;
int port;
if (q != NULL) {
if (sscanf(q + 1, "%u", &port) != 1 || port > 65535)
return "ProxyRemote: Bad syntax for a remote proxy server (bad port number)";
-@@ -571,7 +591,7 @@
+@@ -589,7 +609,7 @@
*p = '\0';
if (strchr(f, ':') == NULL)
- ap_str_tolower(f); /* lowercase scheme */
-- ap_str_tolower(p + 3); /* lowercase hostname */
-+ ap_str_tolower(bl); /* lowercase hostname */
+ ap_str_tolower(f); /* lowercase scheme */
+- ap_str_tolower(p + 3); /* lowercase hostname */
++ ap_str_tolower(bl); /* lowercase hostname */
if (port == -1) {
int i;
-@@ -584,7 +604,7 @@
+@@ -602,7 +622,7 @@
new = ap_push_array(conf->proxies);
new->scheme = f;
new->protocol = r;
new->port = port;
return NULL;
}
-diff -Nur apache_1.3.23.orig/src/modules/proxy/mod_proxy.h apache_1.3.23/src/modules/proxy/mod_proxy.h
---- apache_1.3.23.orig/src/modules/proxy/mod_proxy.h Fri Jan 18 21:26:58 2002
-+++ apache_1.3.23/src/modules/proxy/mod_proxy.h Wed Feb 6 20:20:48 2002
-@@ -308,7 +308,7 @@
+diff -Nur apache_1.3.26.orig/src/modules/proxy/mod_proxy.h apache_1.3.26/src/modules/proxy/mod_proxy.h
+--- apache_1.3.26.orig/src/modules/proxy/mod_proxy.h Sun Apr 21 13:35:07 2002
++++ apache_1.3.26/src/modules/proxy/mod_proxy.h Wed Jun 19 10:26:32 2002
+@@ -310,7 +310,7 @@
int ap_proxy_is_domainname(struct dirconn_entry *This, pool *p);
int ap_proxy_is_hostname(struct dirconn_entry *This, pool *p);
int ap_proxy_is_word(struct dirconn_entry *This, pool *p);
int ap_proxy_garbage_init(server_rec *, pool *);
/* This function is called by ap_table_do() for all header lines */
int ap_proxy_send_hdr_line(void *p, const char *key, const char *value);
-diff -Nur apache_1.3.23.orig/src/modules/proxy/mod_proxy.h.orig apache_1.3.23/src/modules/proxy/mod_proxy.h.orig
---- apache_1.3.23.orig/src/modules/proxy/mod_proxy.h.orig Thu Jan 1 01:00:00 1970
-+++ apache_1.3.23/src/modules/proxy/mod_proxy.h.orig Fri Jan 18 21:26:58 2002
-@@ -0,0 +1,342 @@
-+/* ====================================================================
-+ * The Apache Software License, Version 1.1
-+ *
-+ * Copyright (c) 2000 The Apache Software Foundation. All rights
-+ * reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in
-+ * the documentation and/or other materials provided with the
-+ * distribution.
-+ *
-+ * 3. The end-user documentation included with the redistribution,
-+ * if any, must include the following acknowledgment:
-+ * "This product includes software developed by the
-+ * Apache Software Foundation (http://www.apache.org/)."
-+ * Alternately, this acknowledgment may appear in the software itself,
-+ * if and wherever such third-party acknowledgments normally appear.
-+ *
-+ * 4. The names "Apache" and "Apache Software Foundation" must
-+ * not be used to endorse or promote products derived from this
-+ * software without prior written permission. For written
-+ * permission, please contact apache@apache.org.
-+ *
-+ * 5. Products derived from this software may not be called "Apache",
-+ * nor may "Apache" appear in their name, without prior written
-+ * permission of the Apache Software Foundation.
-+ *
-+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
-+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ * ====================================================================
-+ *
-+ * This software consists of voluntary contributions made by many
-+ * individuals on behalf of the Apache Software Foundation. For more
-+ * information on the Apache Software Foundation, please see
-+ * <http://www.apache.org/>.
-+ *
-+ * Portions of this software are based upon public domain software
-+ * originally written at the National Center for Supercomputing Applications,
-+ * University of Illinois, Urbana-Champaign.
-+ */
-+
-+#ifndef MOD_PROXY_H
-+#define MOD_PROXY_H
-+
-+/*
-+ * Main include file for the Apache proxy
-+ */
-+
-+/*
-+
-+ Note numerous FIXMEs and CHECKMEs which should be eliminated.
-+
-+ If TESTING is set, then garbage collection doesn't delete ... probably a good
-+ idea when hacking.
-+
-+ */
-+
-+#define TESTING 0
-+
-+#include "httpd.h"
-+#include "http_config.h"
-+#include "http_protocol.h"
-+
-+#include "explain.h"
-+
-+extern module MODULE_VAR_EXPORT proxy_module;
-+
-+
-+/* for proxy_canonenc() */
-+enum enctype {
-+ enc_path, enc_search, enc_user, enc_fpath, enc_parm
-+};
-+
-+#define HDR_APP (0) /* append header, for proxy_add_header() */
-+#define HDR_REP (1) /* replace header, for proxy_add_header() */
-+
-+/* number of characters in the hash */
-+#define HASH_LEN (22*2)
-+
-+/* maximum 'CacheDirLevels*CacheDirLength' value */
-+#define CACHEFILE_LEN 20 /* must be less than HASH_LEN/2 */
-+
-+#define SEC_ONE_DAY 86400 /* one day, in seconds */
-+#define SEC_ONE_HR 3600 /* one hour, in seconds */
-+
-+#define DEFAULT_FTP_DATA_PORT 20
-+#define DEFAULT_FTP_PORT 21
-+#define DEFAULT_GOPHER_PORT 70
-+#define DEFAULT_NNTP_PORT 119
-+#define DEFAULT_WAIS_PORT 210
-+#define DEFAULT_HTTPS_PORT 443
-+#define DEFAULT_SNEWS_PORT 563
-+#define DEFAULT_PROSPERO_PORT 1525 /* WARNING: conflict w/Oracle */
-+
-+/* Some WWW schemes and their default ports; this is basically /etc/services */
-+struct proxy_services {
-+ const char *scheme;
-+ int port;
-+};
-+
-+/* static information about a remote proxy */
-+struct proxy_remote {
-+ const char *scheme; /* the schemes handled by this proxy, or '*' */
-+ const char *protocol; /* the scheme used to talk to this proxy */
-+ const char *hostname; /* the hostname of this proxy */
-+ int port; /* the port for this proxy */
-+};
-+
-+struct proxy_alias {
-+ char *real;
-+ char *fake;
-+};
-+
-+struct dirconn_entry {
-+ char *name;
-+ struct in_addr addr, mask;
-+ struct hostent *hostentry;
-+ int (*matcher) (struct dirconn_entry * This, request_rec *r);
-+};
-+
-+struct noproxy_entry {
-+ char *name;
-+ struct in_addr addr;
-+};
-+
-+struct nocache_entry {
-+ char *name;
-+ struct in_addr addr;
-+};
-+
-+#define DEFAULT_CACHE_SPACE 5
-+#define DEFAULT_CACHE_MAXEXPIRE SEC_ONE_DAY
-+#define DEFAULT_CACHE_EXPIRE SEC_ONE_HR
-+#define DEFAULT_CACHE_LMFACTOR (0.1)
-+#define DEFAULT_CACHE_COMPLETION (0.9)
-+#define DEFAULT_CACHE_GCINTERVAL SEC_ONE_HR
-+
-+#ifndef MAX
-+#define MAX(a,b) ((a) > (b) ? (a) : (b))
-+#endif
-+#ifndef MIN
-+#define MIN(a,b) ((a) < (b) ? (a) : (b))
-+#endif
-+
-+/* static information about the local cache */
-+struct cache_conf {
-+ const char *root; /* the location of the cache directory */
-+ off_t space; /* Maximum cache size (in 1024 bytes) */
-+ char space_set;
-+ time_t maxexpire; /* Maximum time to keep cached files in secs */
-+ char maxexpire_set;
-+ time_t defaultexpire; /* default time to keep cached file in secs */
-+ char defaultexpire_set;
-+ double lmfactor; /* factor for estimating expires date */
-+ char lmfactor_set;
-+ time_t gcinterval; /* garbage collection interval, in seconds */
-+ char gcinterval_set;
-+ int dirlevels; /* Number of levels of subdirectories */
-+ char dirlevels_set;
-+ int dirlength; /* Length of subdirectory names */
-+ char dirlength_set;
-+ float cache_completion; /* Force cache completion after this point */
-+ char cache_completion_set;
-+};
-+
-+typedef struct {
-+ struct cache_conf cache; /* cache configuration */
-+ array_header *proxies;
-+ array_header *aliases;
-+ array_header *raliases;
-+ array_header *noproxies;
-+ array_header *dirconn;
-+ array_header *nocaches;
-+ array_header *allowed_connect_ports;
-+ char *domain; /* domain name to use in absence of a domain name in the request */
-+ int req; /* true if proxy requests are enabled */
-+ char req_set;
-+ enum {
-+ via_off,
-+ via_on,
-+ via_block,
-+ via_full
-+ } viaopt; /* how to deal with proxy Via: headers */
-+ char viaopt_set;
-+ size_t recv_buffer_size;
-+ char recv_buffer_size_set;
-+} proxy_server_conf;
-+
-+struct hdr_entry {
-+ const char *field;
-+ const char *value;
-+};
-+
-+/* caching information about a request */
-+typedef struct {
-+ request_rec *req; /* the request */
-+ char *url; /* the URL requested */
-+ char *filename; /* name of the cache file,
-+ or NULL if no cache */
-+ char *tempfile; /* name of the temporary file,
-+ or NULL if not caching */
-+ time_t ims; /* if-Modified-Since date of request,
-+ -1 if no header */
-+ time_t ius; /* if-Unmodified-Since date of request,
-+ -1 if no header */
-+ const char *im; /* if-Match etag of request,
-+ NULL if no header */
-+ const char *inm; /* if-None-Match etag of request,
-+ NULL if no header */
-+ BUFF *fp; /* the cache file descriptor if the file
-+ is cached and may be returned,
-+ or NULL if the file is not cached
-+ (or must be reloaded) */
-+ BUFF *origfp; /* the old cache file descriptor if the file has
-+ been revalidated and is being rewritten to
-+ disk */
-+ time_t expire; /* calculated expire date of cached entity */
-+ time_t lmod; /* last-modified date of cached entity */
-+ time_t date; /* the date the cached file was last touched */
-+ time_t req_time; /* the time the request started */
-+ time_t resp_time; /* the time the response was received */
-+ int version; /* update count of the file */
-+ off_t len; /* content length */
-+ char *protocol; /* Protocol, and major/minor number,
-+ e.g. HTTP/1.1 */
-+ int status; /* the status of the cached file */
-+ unsigned int written; /* total *content* bytes written to cache */
-+ float cache_completion; /* specific to this request */
-+ char *resp_line; /* the whole status line
-+ (protocol, code + message) */
-+ table *req_hdrs; /* the original request headers */
-+ table *hdrs; /* the original HTTP response headers
-+ of the file */
-+ char *xcache; /* the X-Cache header value
-+ to be sent to client */
-+} cache_req;
-+
-+struct per_thread_data {
-+ struct hostent hpbuf;
-+ u_long ipaddr;
-+ char *charpbuf[2];
-+};
-+/* Function prototypes */
-+
-+/* proxy_cache.c */
-+
-+void ap_proxy_cache_tidy(cache_req *c);
-+int ap_proxy_cache_check(request_rec *r, char *url, struct cache_conf *conf,
-+ cache_req **cr);
-+int ap_proxy_cache_update(cache_req *c, table *resp_hdrs,
-+ const int is_HTTP1, int nocache);
-+void ap_proxy_garbage_coll(request_rec *r);
-+
-+/* proxy_connect.c */
-+
-+int ap_proxy_connect_handler(request_rec *r, cache_req *c, char *url,
-+ const char *proxyhost, int proxyport);
-+
-+/* proxy_ftp.c */
-+
-+int ap_proxy_ftp_canon(request_rec *r, char *url);
-+int ap_proxy_ftp_handler(request_rec *r, cache_req *c, char *url);
-+
-+/* proxy_http.c */
-+
-+int ap_proxy_http_canon(request_rec *r, char *url, const char *scheme,
-+ int def_port);
-+int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
-+ const char *proxyhost, int proxyport);
-+
-+/* proxy_util.c */
-+
-+int ap_proxy_hex2c(const char *x);
-+void ap_proxy_c2hex(int ch, char *x);
-+char *ap_proxy_canonenc(pool *p, const char *x, int len, enum enctype t,
-+ enum proxyreqtype isenc);
-+char *ap_proxy_canon_netloc(pool *p, char **const urlp, char **userp,
-+ char **passwordp, char **hostp, int *port);
-+const char *ap_proxy_date_canon(pool *p, const char *x);
-+table *ap_proxy_read_headers(request_rec *r, char *buffer, int size, BUFF *f);
-+long int ap_proxy_send_fb(BUFF *f, request_rec *r, cache_req *c, off_t len, int nowrite);
-+void ap_proxy_write_headers(cache_req *c, const char *respline, table *t);
-+int ap_proxy_liststr(const char *list, const char *key, char **val);
-+void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength);
-+int ap_proxy_hex2sec(const char *x);
-+void ap_proxy_sec2hex(int t, char *y);
-+cache_req *ap_proxy_cache_error(cache_req *r);
-+int ap_proxyerror(request_rec *r, int statuscode, const char *message);
-+const char *ap_proxy_host2addr(const char *host, struct hostent *reqhp);
-+int ap_proxy_is_ipaddr(struct dirconn_entry *This, pool *p);
-+int ap_proxy_is_domainname(struct dirconn_entry *This, pool *p);
-+int ap_proxy_is_hostname(struct dirconn_entry *This, pool *p);
-+int ap_proxy_is_word(struct dirconn_entry *This, pool *p);
-+int ap_proxy_doconnect(int sock, struct sockaddr_in *addr, request_rec *r);
-+int ap_proxy_garbage_init(server_rec *, pool *);
-+/* This function is called by ap_table_do() for all header lines */
-+int ap_proxy_send_hdr_line(void *p, const char *key, const char *value);
-+unsigned ap_proxy_bputs2(const char *data, BUFF *client, cache_req *cache);
-+time_t ap_proxy_current_age(cache_req *c, const time_t age_value);
-+BUFF *ap_proxy_open_cachefile(request_rec *r, char *filename);
-+BUFF *ap_proxy_create_cachefile(request_rec *r, char *filename);
-+void ap_proxy_clear_connection(pool *p, table *headers);
-+int ap_proxy_table_replace(table *base, table *overlay);
-+
-+/* WARNING - PRIVATE DEFINITION BELOW */
-+
-+/* XXX: if you tweak this you should look at is_empty_table() and table_elts()
-+ * in ap_alloc.h
-+ *
-+ * NOTE: this private definition is a duplicate of the one in alloc.c
-+ * It's here for ap_proxy_table_replace() to avoid breaking binary compat
-+ */
-+struct table {
-+ /* This has to be first to promote backwards compatibility with
-+ * older modules which cast a table * to an array_header *...
-+ * they should use the table_elts() function for most of the
-+ * cases they do this for.
-+ */
-+ array_header a;
-+#ifdef MAKE_TABLE_PROFILE
-+ void *creator;
-+#endif
-+};
-+
-+#endif /*MOD_PROXY_H*/
-diff -Nur apache_1.3.23.orig/src/modules/proxy/proxy_connect.c apache_1.3.23/src/modules/proxy/proxy_connect.c
---- apache_1.3.23.orig/src/modules/proxy/proxy_connect.c Sun Jan 20 21:14:37 2002
-+++ apache_1.3.23/src/modules/proxy/proxy_connect.c Wed Feb 6 20:49:52 2002
-@@ -114,14 +114,15 @@
- const char *proxyhost, int proxyport)
+diff -Nur apache_1.3.26.orig/src/modules/proxy/proxy_connect.c apache_1.3.26/src/modules/proxy/proxy_connect.c
+--- apache_1.3.26.orig/src/modules/proxy/proxy_connect.c Mon Mar 25 10:21:58 2002
++++ apache_1.3.26/src/modules/proxy/proxy_connect.c Wed Jun 19 10:38:06 2002
+@@ -113,14 +113,15 @@
+ const char *proxyhost, int proxyport)
{
struct sockaddr_in server;
- struct in_addr destaddr;
void *sconf = r->server->module_config;
proxy_server_conf *conf =
-@@ -129,27 +130,59 @@
- struct noproxy_entry *npent = (struct noproxy_entry *)conf->noproxies->elts;
+@@ -128,27 +129,59 @@
+ struct noproxy_entry *npent = (struct noproxy_entry *) conf->noproxies->elts;
memset(&server, '\0', sizeof(server));
+#ifdef HAVE_SOCKADDR_LEN
}
/* Check if it is an allowed port */
-@@ -160,33 +193,41 @@
- case DEFAULT_SNEWS_PORT:
- break;
- default:
-+ freeaddrinfo(res0);
- return HTTP_FORBIDDEN;
+@@ -159,34 +192,42 @@
+ case DEFAULT_SNEWS_PORT:
+ break;
+ default:
++ freeaddrinfo(res0);
+ return HTTP_FORBIDDEN;
}
-- } else if(!allowed_port(conf, port))
-+ } else if(!allowed_port(conf, port)) {
-+ freeaddrinfo(res0);
+ }
+- else if (!allowed_port(conf, port))
++ else if (!allowed_port(conf, port)) {
++ freeaddrinfo(res0);
return HTTP_FORBIDDEN;
+ }
+ if (error)
+ return HTTP_INTERNAL_SERVER_ERROR; /* XXX */
+
- ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server,
- "CONNECT to remote proxy %s on port %d", proxyhost, proxyport);
+ ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server,
+ "CONNECT to remote proxy %s on port %d", proxyhost, proxyport);
}
else {
- ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server,
-- "CONNECT to %s on port %d", host, port);
-+ "CONNECT to %s on port %d", hoststr, port);
+ ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server,
+- "CONNECT to %s on port %d", host, port);
++ "CONNECT to %s on port %d", hoststr, port);
}
- /* Nasty cast to work around broken terniary expressions on MSVC */
-
- if (err != NULL)
- return ap_proxyerror(r,
-- proxyhost ? HTTP_BAD_GATEWAY : HTTP_INTERNAL_SERVER_ERROR, err);
+- proxyhost ? HTTP_BAD_GATEWAY : HTTP_INTERNAL_SERVER_ERROR, err);
-
- sock = ap_psocket(r->pool, PF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (sock == -1) {
#ifdef CHECK_FD_SETSIZE
if (sock >= FD_SETSIZE) {
@@ -196,19 +237,15 @@
- "found, you probably need to rebuild Apache with a "
- "larger FD_SETSIZE", sock, FD_SETSIZE);
+ "found, you probably need to rebuild Apache with a "
+ "larger FD_SETSIZE", sock, FD_SETSIZE);
ap_pclosesocket(r->pool, sock);
- return HTTP_INTERNAL_SERVER_ERROR;
+ continue;
if (i == -1) {
ap_pclosesocket(r->pool, sock);
return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR, ap_pstrcat(r->pool,
-diff -Nur apache_1.3.23.orig/src/modules/proxy/proxy_ftp.c apache_1.3.23/src/modules/proxy/proxy_ftp.c
---- apache_1.3.23.orig/src/modules/proxy/proxy_ftp.c Sun Jan 20 21:14:37 2002
-+++ apache_1.3.23/src/modules/proxy/proxy_ftp.c Wed Feb 6 21:08:39 2002
+diff -Nur apache_1.3.26.orig/src/modules/proxy/proxy_ftp.c apache_1.3.26/src/modules/proxy/proxy_ftp.c
+--- apache_1.3.26.orig/src/modules/proxy/proxy_ftp.c Sun Apr 7 20:57:36 2002
++++ apache_1.3.26/src/modules/proxy/proxy_ftp.c Wed Jun 19 10:49:53 2002
@@ -62,6 +62,7 @@
#include "http_main.h"
#include "http_log.h"
#define AUTODETECT_PWD
-@@ -451,8 +452,10 @@
+@@ -555,8 +556,10 @@
const char *err;
- int port, i, j, len, sock, dsock, rc, nocache = 0;
- int csd = 0;
+ int port, i, j, len, rc, nocache = 0;
+ int csd = 0, sock = -1, dsock = -1;
- struct sockaddr_in server;
- struct hostent server_hp;
+ struct sockaddr_storage server;
+ int error;
struct in_addr destaddr;
table *resp_hdrs;
- BUFF *f;
-@@ -471,11 +474,18 @@
+ BUFF *ctrl = NULL;
+@@ -577,11 +580,18 @@
unsigned int presult, h0, h1, h2, h3, p0, p1;
unsigned int paddr;
unsigned short pport;
/* stuff for responses */
char resp[MAX_STRING_LEN];
char *size = NULL;
-@@ -545,62 +555,52 @@
+@@ -658,62 +668,52 @@
if (parms != NULL)
*(parms++) = '\0';
- sock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (sock == -1) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-- "proxy: error creating socket");
+- "proxy: error creating socket");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
+ ap_snprintf(portbuf, sizeof(portbuf), "%d", port);
#if !defined(TPF) && !defined(BEOS)
- if (conf->recv_buffer_size > 0
- && setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
-- (const char *) &conf->recv_buffer_size, sizeof(int))
-- == -1) {
-- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-- "setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
+- (const char *)&conf->recv_buffer_size, sizeof(int))
+- == -1) {
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
+- "setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
- }
+ if (conf->recv_buffer_size > 0
+ && setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
-+ (const char *) &conf->recv_buffer_size, sizeof(int))
++ (const char *)&conf->recv_buffer_size, sizeof(int))
+ == -1) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
+ "setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
+ }
#endif
-- if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &one,
+- if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one,
- sizeof(one)) == -1) {
-+ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &one,
++ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one,
+ sizeof(one)) == -1) {
- #ifndef _OSD_POSIX /* BS2000 has this option "always on" */
+ #ifndef _OSD_POSIX /* BS2000 has this option "always on" */
- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-- "proxy: error setting reuseaddr option: setsockopt(SO_REUSEADDR)");
+- "proxy: error setting reuseaddr option: setsockopt(SO_REUSEADDR)");
- ap_pclosesocket(p, sock);
- return HTTP_INTERNAL_SERVER_ERROR;
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
+ ap_pclosesocket(p, sock);
+ freeaddrinfo(res0);
+ return HTTP_INTERNAL_SERVER_ERROR;
- #endif /*_OSD_POSIX*/
+ #endif /* _OSD_POSIX */
- }
-
-#ifdef SINIX_D_RESOLVER_BUG
- {
-- struct in_addr *ip_addr = (struct in_addr *) *server_hp.h_addr_list;
+- struct in_addr *ip_addr = (struct in_addr *)*server_hp.h_addr_list;
-
- for (; ip_addr->s_addr != 0; ++ip_addr) {
- memcpy(&server.sin_addr, ip_addr, sizeof(struct in_addr));
- if (i == 0)
+
+ i = ap_proxy_doconnect(sock, res->ai_addr, r);
-+ if (i == 0){
++ if (i == 0) {
+ memcpy(&server, res->ai_addr, res->ai_addrlen);
break;
- j++;
-#endif
+ freeaddrinfo(res0);
if (i == -1) {
- ap_pclosesocket(p, sock);
- return ap_proxyerror(r, HTTP_BAD_GATEWAY, ap_pstrcat(r->pool,
-@@ -807,7 +807,7 @@
+ return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
+ ap_proxyerror(r, HTTP_BAD_GATEWAY, ap_pstrcat(r->pool,
+@@ -944,7 +944,7 @@
}
/* try to set up PASV data connection first */
- dsock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
+ dsock = ap_psocket(p, server.ss_family, SOCK_STREAM, IPPROTO_TCP);
if (dsock == -1) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
- "proxy: error creating PASV socket");
-@@ -826,11 +826,22 @@
+ return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
+ ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
+@@ -961,11 +961,22 @@
}
#endif
-- ap_bputs("PASV" CRLF, f);
+- ap_bputs("PASV" CRLF, ctrl);
+lpsvagain:
+ if (server.ss_family == AF_INET)
+ cmd = "PASV";
+ cmd = "LPSV";
+ else
+ cmd = "EPSV";
-+ ap_bputs(cmd, f);
-+ ap_bputs(CRLF, f);
- ap_bflush(f);
++ ap_bputs(cmd, ctrl);
++ ap_bputs(CRLF, ctrl);
+ ap_bflush(ctrl);
+ Explain0("FTP: passive command issued");
- ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: PASV command issued");
+ ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server, "FTP: PASV command issued");
-/* possible results: 227, 421, 500, 501, 502, 530 */
-+ /* possible results: 227, 228, 229, 421, 500, 501, 502, 530 */
++/* possible results: 227, 228, 229, 421, 500, 501, 502, 530 */
/* 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). */
+ /* 228 Entering Long Passive Mode (...). */
+ /* 229 Entering Extended Passive Mode (...). */
/* 421 Service not available, closing control connection. */
/* 500 Syntax error, command unrecognized. */
/* 501 Syntax error in parameters or arguments. */
-@@ -839,7 +850,7 @@
- i = ap_bgets(pasv, sizeof(pasv), f);
- if (i == -1) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r,
-- "PASV: control connection is toast");
-+ "%s: control connection is toast", cmd);
- ap_pclosesocket(p, dsock);
- ap_bclose(f);
- ap_kill_timeout(r);
-@@ -871,10 +882,14 @@
+@@ -976,7 +987,7 @@
+ if (i == -1 || i == 421) {
+ return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
+ ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
+- "proxy: PASV: control connection is toast"));
++ ap_psprintf(p, "proxy: %s: control connection is toast", cmd)));
+ }
+ else {
+ pasv[i - 1] = '\0';
+@@ -1004,10 +1015,14 @@
pport = (p1 << 8) + p0;
- ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: contacting host %d.%d.%d.%d:%d",
- h3, h2, h1, h0, pport);
+ ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server, "FTP: contacting host %d.%d.%d.%d:%d",
+ h3, h2, h1, h0, pport);
- data_addr.sin_family = AF_INET;
- data_addr.sin_addr.s_addr = htonl(paddr);
- data_addr.sin_port = htons(pport);
+ i = ap_proxy_doconnect(dsock, (struct sockaddr *)&data_addr, r);
if (i == -1) {
- ap_kill_timeout(r);
-@@ -886,13 +901,73 @@
- else {
- pasvmode = 1;
+ return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
+@@ -1017,6 +1032,64 @@
+ strerror(errno), NULL)));
}
+ pasvmode = 1;
+ } else if (presult == 228 && pstr != NULL
+ && sscanf(pstr,
+"%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u",
+ i = ap_proxy_doconnect(dsock, (struct sockaddr *)&data_addr, r);
+
+ if (i == -1) {
-+ ap_kill_timeout(r);
-+ return ap_proxyerror(r, HTTP_BAD_GATEWAY,
-+ ap_pstrcat(r->pool,
-+ "Could not connect to remote machine: ",
-+ strerror(errno), NULL));
-+ } else {
-+ pasvmode = 1;
++ return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
++ ap_proxyerror(r, HTTP_BAD_GATEWAY,
++ ap_pstrcat(r->pool,
++ "Could not connect to remote machine: ",
++ strerror(errno), NULL)));
+ }
++ pasvmode = 1;
+ } else if (presult == 229 && pstr != NULL
+ && pstr[0] == pstr[1] && pstr[0] == pstr[2]
+ && pstr[0] == pstr[strlen(pstr) - 1]) {
+ i = ap_proxy_doconnect(dsock, (struct sockaddr *)&data_addr, r);
+
+ if (i == -1) {
-+ ap_kill_timeout(r);
-+ return ap_proxyerror(r, HTTP_BAD_GATEWAY,
-+ ap_pstrcat(r->pool,
-+ "Could not connect to remote machine: ",
-+ strerror(errno), NULL));
-+ } else {
-+ pasvmode = 1;
++ return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
++ ap_proxyerror(r, HTTP_BAD_GATEWAY,
++ ap_pstrcat(r->pool,
++ "Could not connect to remote machine: ",
++ strerror(errno), NULL)));
+ }
++ pasvmode = 1;
+ } else if (!lpsvmode && strcmp(cmd, "EPSV") == 0) {
+ lpsvmode = 1;
+ goto lpsvagain;
}
- else
+ else {
ap_pclosesocket(p, dsock); /* and try the regular way */
+@@ -1025,14 +1098,14 @@
}
if (!pasvmode) { /* set up data connection */
- clen = sizeof(struct sockaddr_in);
-+ clen = sizeof(server);
- if (getsockname(sock, (struct sockaddr *) &server, &clen) < 0) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
- "proxy: error getting socket address");
-@@ -901,7 +976,7 @@
- return HTTP_INTERNAL_SERVER_ERROR;
++ clen = sizeof(server);
+ if (getsockname(sock, (struct sockaddr *)&server, &clen) < 0) {
+ return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
+ ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
+ "proxy: error getting socket address"));
}
- dsock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
+ dsock = ap_psocket(p, server.ss_family, SOCK_STREAM, IPPROTO_TCP);
if (dsock == -1) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
- "proxy: error creating socket");
-@@ -922,13 +997,26 @@
- #endif /*_OSD_POSIX*/
+ return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
+ ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
+@@ -1048,13 +1121,28 @@
+ #endif /* _OSD_POSIX */
}
-- if (bind(dsock, (struct sockaddr *) &server,
+- if (bind(dsock, (struct sockaddr *)&server,
- sizeof(struct sockaddr_in)) == -1) {
-- char buff[22];
+#ifndef SIN6_LEN
-+ if (bind(dsock, (struct sockaddr *) &server, SA_LEN((struct sockaddr *)&server)) == -1)
++ if (bind(dsock, (struct sockaddr *)&server, SA_LEN((struct sockaddr *)&server)) == -1)
+#else
-+ if (bind(dsock, (struct sockaddr *) &server, server.ss_len) == -1)
++ if (bind(dsock, (struct sockaddr *)&server, server.ss_len) == -1)
+#endif
-+ {
++ {
+ char hostnamebuf[MAXHOSTNAMELEN], portnamebuf[MAXHOSTNAMELEN];
-
++
+ getnameinfo((struct sockaddr *)&server,
+#ifndef SIN6_LEN
+ SA_LEN((struct sockaddr *)&server),
+ hostnamebuf, sizeof(hostnamebuf),
+ portnamebuf, sizeof(portnamebuf),
+ NI_NUMERICHOST | NI_NUMERICSERV);
-- ap_snprintf(buff, sizeof(buff), "%s:%d", inet_ntoa(server.sin_addr), server.sin_port);
- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-- "proxy: error binding to ftp data socket %s", buff);
-+ "proxy: error binding to ftp data socket %s:%s",
-+ hostnamebuf, portnamebuf);
- ap_bclose(f);
- ap_pclosesocket(p, dsock);
- return HTTP_INTERNAL_SERVER_ERROR;
-@@ -1187,7 +1276,7 @@
+
+ return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
+ ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
+- ap_psprintf(p, "proxy: error binding to ftp data socket %s:%d",
+- inet_ntoa(server.sin_addr), server.sin_port)));
++ ap_psprintf(p, "proxy: error binding to ftp data socket %s:%s",
++ hostnamebuf, portnamebuf)));
+ }
+ listen(dsock, 2); /* only need a short queue */
+ }
+@@ -1308,7 +1396,7 @@
if (!pasvmode) { /* wait for connection */
ap_hard_timeout("proxy ftp data connect", r);
- clen = sizeof(struct sockaddr_in);
+ clen = sizeof(server);
do
- csd = accept(dsock, (struct sockaddr *) &server, &clen);
+ csd = accept(dsock, (struct sockaddr *)&server, &clen);
while (csd == -1 && errno == EINTR);
-diff -Nur apache_1.3.23.orig/src/modules/proxy/proxy_http.c apache_1.3.23/src/modules/proxy/proxy_http.c
---- apache_1.3.23.orig/src/modules/proxy/proxy_http.c Wed Feb 6 20:17:43 2002
-+++ apache_1.3.23/src/modules/proxy/proxy_http.c Wed Feb 6 21:18:32 2002
-@@ -155,9 +155,8 @@
+diff -Nur apache_1.3.26.orig/src/modules/proxy/proxy_http.c apache_1.3.26/src/modules/proxy/proxy_http.c
+--- apache_1.3.26.orig/src/modules/proxy/proxy_http.c Wed Jun 19 10:25:56 2002
++++ apache_1.3.26/src/modules/proxy/proxy_http.c Wed Jun 19 11:00:47 2002
+@@ -156,9 +156,8 @@
table *req_hdrs, *resp_hdrs;
array_header *reqhdrs_arr;
table_entry *reqhdrs_elts;
BUFF *f;
char buffer[HUGE_STRING_LEN];
char portstr[32];
-@@ -179,9 +178,6 @@
-
- if (conf->cache.root == NULL) nocache = 1;
+@@ -184,9 +183,6 @@
+ if (conf->cache.root == NULL)
+ nocache = 1;
- memset(&server, '\0', sizeof(server));
- server.sin_family = AF_INET;
/* We break the URL into host, port, path-search */
urlptr = strstr(url, "://");
-@@ -189,6 +185,8 @@
+@@ -194,6 +190,8 @@
return HTTP_BAD_REQUEST;
urlptr += 3;
destport = DEFAULT_HTTP_PORT;
#ifdef EAPI
ap_hook_use("ap::mod_proxy::http::handler::set_destport",
AP_HOOK_SIG2(int,ptr),
-@@ -207,7 +205,20 @@
+@@ -212,7 +210,20 @@
urlptr = strp;
desthost = q;
}
strp2 = strchr(desthost, ':');
if (strp2 != NULL) {
*(strp2++) = '\0';
-@@ -218,45 +229,69 @@
+@@ -223,46 +234,70 @@
}
/* check if ProxyBlock directive on this host */
- for (i = 0; i < conf->noproxies->nelts; i++) {
- if (destaddr.s_addr == npent[i].addr.s_addr ||
- (npent[i].name != NULL &&
-- (npent[i].name[0] == '*' || strstr(desthost, npent[i].name) != NULL)))
-+ memset(&hints, 0, sizeof(hints));
-+ hints.ai_family = PF_UNSPEC;
-+ hints.ai_socktype = SOCK_STREAM;
-+ hints.ai_protocol = IPPROTO_TCP;
-+ error = getaddrinfo(desthost, destportstr, &hints, &res0);
-+ if (error) {
-+ return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
+- (npent[i].name[0] == '*' || strstr(desthost, npent[i].name) != NULL)))
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_protocol = IPPROTO_TCP;
++ error = getaddrinfo(desthost, destportstr, &hints, &res0);
++ if (error) {
++ return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
+ gai_strerror(error)); /* give up */
-+ }
++ }
+
-+ /* check if ProxyBlock directive on this host */
-+ for (res = res0; res; res = res->ai_next) {
-+ struct sockaddr_in *sin;
-+ #ifdef INET6
-+ struct sockaddr_in6 *sin6;
-+ #endif
-+ int fail;
-+
-+ fail = 0;
-+ for (i = 0; i < conf->noproxies->nelts; i++) {
-+ if (npent[i].name != NULL && strstr(desthost, npent[i].name))
-+ fail++;
-+ if (npent[i].name != NULL && strcmp(npent[i].name, "*") == 0)
-+ fail++;
-+ switch (res->ai_family) {
-+ case AF_INET:
-+ sin = (struct sockaddr_in *)res->ai_addr;
-+ if (sin->sin_addr.s_addr == npent[i].addr.s_addr)
-+ fail++;
-+ break;
-+ }
++ /* check if ProxyBlock directive on this host */
++ for (res = res0; res; res = res->ai_next) {
++ struct sockaddr_in *sin;
++#ifdef INET6
++ struct sockaddr_in6 *sin6;
++#endif
++ int fail;
++
++ fail = 0;
++ for (i = 0; i < conf->noproxies->nelts; i++) {
++ if (npent[i].name != NULL && strstr(desthost, npent[i].name))
++ fail++;
++ if (npent[i].name != NULL && strcmp(npent[i].name, "*") == 0)
++ fail++;
++ switch (res->ai_family) {
++ case AF_INET:
++ sin = (struct sockaddr_in *)res->ai_addr;
++ if (sin->sin_addr.s_addr == npent[i].addr.s_addr)
++ fail++;
++ break;
+ }
-+ if (fail) {
-+ freeaddrinfo(res0);
++ }
++ if (fail) {
++ freeaddrinfo(res0);
return ap_proxyerror(r, HTTP_FORBIDDEN,
"Connect to remote machine blocked");
-- }
--
-- if (proxyhost != NULL) {
++ }
+ }
+
+ if (proxyhost != NULL) {
- server.sin_port = htons((unsigned short)proxyport);
- err = ap_proxy_host2addr(proxyhost, &server_hp);
- if (err != NULL)
-+ }
-+ }
-+
-+ if (proxyhost != NULL) {
-+ char pbuf[10];
-+
-+ freeaddrinfo(res0);
-+ ap_snprintf(pbuf, sizeof(pbuf), "%d", proxyport);
-+ memset(&hints, 0, sizeof(hints));
-+ hints.ai_family = PF_UNSPEC;
-+ hints.ai_socktype = SOCK_STREAM;
-+ hints.ai_protocol = IPPROTO_TCP;
-+ error = getaddrinfo(proxyhost, pbuf, &hints, &res0);
-+ if (error)
++ char pbuf[10];
++
++ freeaddrinfo(res0);
++ ap_snprintf(pbuf, sizeof(pbuf), "%d", proxyport);
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_protocol = IPPROTO_TCP;
++ error = getaddrinfo(proxyhost, pbuf, &hints, &res0);
++ if (error)
return DECLINED; /* try another */
--#ifdef EAPI
-- peer = ap_psprintf(p, "%s:%u", proxyhost, proxyport);
--#endif
-- }
+ #ifdef EAPI
+ peer = ap_psprintf(p, "%s:%u", proxyhost, proxyport);
+ #endif
+ }
- else {
- server.sin_port = htons((unsigned short)destport);
- err = ap_proxy_host2addr(desthost, &server_hp);
- }
-
-
-- /* we have worked out who exactly we are going to connect to, now
-- * make that connection...
+- /*
+- * we have worked out who exactly we are going to connect to, now make
+- * that connection...
- */
- sock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (sock == -1) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-- "proxy: error creating socket");
+- "proxy: error creating socket");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
--
-+ #ifdef EAPI
-+ peer = ap_psprintf(p, "%s:%u", proxyhost, proxyport);
-+ #endif
-+ }
-+
-+ sock = i = -1;
-+ for (res = res0; res; res = res->ai_next) {
-+ sock = ap_psocket(p, res->ai_family, res->ai_socktype,
-+ res->ai_protocol);
-+ if (sock < 0)
-+ continue;
-+
+
++
++ sock = i = -1;
++ for (res = res0; res; res = res->ai_next) {
++ sock = ap_psocket(p, res->ai_family, res->ai_socktype,
++ res->ai_protocol);
++ if (sock < 0)
++ continue;
++
#if !defined(TPF) && !defined(BEOS)
if (conf->recv_buffer_size) {
if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
-@@ -268,28 +303,12 @@
+@@ -274,28 +309,12 @@
}
#endif
-#ifdef SINIX_D_RESOLVER_BUG
- {
-- struct in_addr *ip_addr = (struct in_addr *) *server_hp.h_addr_list;
+- struct in_addr *ip_addr = (struct in_addr *)*server_hp.h_addr_list;
-
- for (; ip_addr->s_addr != 0; ++ip_addr) {
- memcpy(&server.sin_addr, ip_addr, sizeof(struct in_addr));
if (i == -1) {
if (proxyhost != NULL)
return DECLINED; /* try again another way */
-@@ -544,16 +563,30 @@
- ap_table_set(resp_hdrs, "Content-Location", proxy_location_reverse_map(r , urlstr));
+@@ -599,17 +618,30 @@
+ ap_table_set(resp_hdrs, "Content-Location", proxy_location_reverse_map(r, urlstr));
/* check if NoCache directive on this host */
+ {
for (i = 0; i < conf->nocaches->nelts; i++) {
- if (destaddr.s_addr == ncent[i].addr.s_addr ||
- (ncent[i].name != NULL &&
-- (ncent[i].name[0] == '*' ||
-- strstr(desthost, ncent[i].name) != NULL))) {
-- nocache = 1;
-- break;
+- (ncent[i].name[0] == '*' ||
+- strstr(desthost, ncent[i].name) != NULL))) {
+- nocache = 1;
+- break;
+ if (ncent[i].name != NULL &&
+ (ncent[i].name[0] == '*' ||
+ strstr(desthost, ncent[i].name) != NULL)) {
+ }
}
}
-+ }
-
- /* update the cache file, possibly even fulfilling the request if
- * it turns out a conditional allowed us to serve the object from the
-diff -Nur apache_1.3.23.orig/src/modules/proxy/proxy_util.c apache_1.3.23/src/modules/proxy/proxy_util.c
---- apache_1.3.23.orig/src/modules/proxy/proxy_util.c Fri Jan 18 21:26:58 2002
-+++ apache_1.3.23/src/modules/proxy/proxy_util.c Wed Feb 6 21:25:17 2002
+-
++ }
+ /*
+ * update the cache file, possibly even fulfilling the request if it
+ * turns out a conditional allowed us to serve the object from the
+diff -Nur apache_1.3.26.orig/src/modules/proxy/proxy_util.c apache_1.3.26/src/modules/proxy/proxy_util.c
+--- apache_1.3.26.orig/src/modules/proxy/proxy_util.c Tue Jun 18 02:59:59 2002
++++ apache_1.3.26/src/modules/proxy/proxy_util.c Wed Jun 19 11:05:11 2002
@@ -64,6 +64,7 @@
#include "http_log.h"
#include "util_uri.h"
- #include "util_date.h" /* get ap_checkmask() decl. */
+ #include "util_date.h" /* get ap_checkmask() decl. */
+#include "sa_len.h"
static int proxy_match_ipaddr(struct dirconn_entry *This, request_rec *r);
static int proxy_match_domainname(struct dirconn_entry *This, request_rec *r);
-@@ -218,6 +219,7 @@
+@@ -219,6 +220,7 @@
int i;
char *strp, *host, *url = *urlp;
char *user = NULL, *password = NULL;
if (url[0] != '/' || url[1] != '/')
return "Malformed URL";
-@@ -256,11 +258,22 @@
+@@ -257,11 +259,22 @@
*passwordp = password;
}
if (!ap_isdigit(strp[i]))
break;
-@@ -278,17 +291,29 @@
+@@ -280,17 +293,29 @@
return "Missing host in URL";
/* check hostname syntax */
for (i = 0; host[i] != '\0'; i++)
/* if (strchr(host,'.') == NULL && domain != NULL)
host = pstrcat(p, host, domain, NULL);
-@@ -1284,22 +1309,45 @@
+@@ -1359,22 +1384,46 @@
return host != NULL && strstr(host, This->name) != NULL;
}
+ }
+#endif
do {
-- i = connect(sock, (struct sockaddr *) addr, sizeof(struct sockaddr_in));
+- i = connect(sock, (struct sockaddr *)addr, sizeof(struct sockaddr_in));
+ i = connect(sock, addr, salen);
#if defined(WIN32) || defined(NETWARE)
if (i == SOCKET_ERROR)
errno = WSAGetLastError();
- #endif /* WIN32 */
+ #endif /* WIN32 */
} while (i == -1 && errno == EINTR);
if (i == -1) {
+ if (getnameinfo(addr, salen, hbuf, sizeof(hbuf), pbuf, sizeof(pbuf),
+ strcpy(pbuf, "?");
+ }
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-- "proxy connect to %s port %d failed",
-- inet_ntoa(addr->sin_addr), ntohs(addr->sin_port));
-+ "proxy connect to %s port %d failed", hbuf, pbuf);
+ "proxy connect to %s port %d failed",
+- inet_ntoa(addr->sin_addr), ntohs(addr->sin_port));
++ hbuf, pbuf);
}
ap_kill_timeout(r);
-diff -Nur apache_1.3.23.orig/src/modules/standard/mod_access.c apache_1.3.23/src/modules/standard/mod_access.c
---- apache_1.3.23.orig/src/modules/standard/mod_access.c Mon Jan 15 18:05:34 2001
-+++ apache_1.3.23/src/modules/standard/mod_access.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/modules/standard/mod_access.c apache_1.3.26/src/modules/standard/mod_access.c
+--- apache_1.3.26.orig/src/modules/standard/mod_access.c Wed Mar 13 22:05:33 2002
++++ apache_1.3.26/src/modules/standard/mod_access.c Wed Jun 19 10:26:32 2002
@@ -74,7 +74,10 @@
T_ALL,
T_IP,
case T_HOST:
if (!gothost) {
-diff -Nur apache_1.3.23.orig/src/modules/standard/mod_unique_id.c apache_1.3.23/src/modules/standard/mod_unique_id.c
---- apache_1.3.23.orig/src/modules/standard/mod_unique_id.c Tue Oct 2 18:11:13 2001
-+++ apache_1.3.23/src/modules/standard/mod_unique_id.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/modules/standard/mod_unique_id.c apache_1.3.26/src/modules/standard/mod_unique_id.c
+--- apache_1.3.26.orig/src/modules/standard/mod_unique_id.c Wed Mar 13 22:05:34 2002
++++ apache_1.3.26/src/modules/standard/mod_unique_id.c Wed Jun 19 10:26:32 2002
@@ -67,10 +67,22 @@
#include "http_config.h"
#include "http_log.h"
/*
* If we use 0 as the initial counter we have a little less protection
-diff -Nur apache_1.3.23.orig/src/support/ab.c apache_1.3.23/src/support/ab.c
---- apache_1.3.23.orig/src/support/ab.c Mon Oct 8 19:54:42 2001
-+++ apache_1.3.23/src/support/ab.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/support/ab.c apache_1.3.26/src/support/ab.c
+--- apache_1.3.26.orig/src/support/ab.c Sat May 11 22:47:57 2002
++++ apache_1.3.26/src/support/ab.c Wed Jun 19 11:08:58 2002
@@ -158,6 +158,8 @@
#include <sys/uio.h>
#endif
int isproxy = 0;
char path[1024]; /* path name */
char postfile[1024]; /* name of file containing post data */
-@@ -261,7 +263,7 @@
+@@ -262,7 +264,7 @@
auth[1024], /* optional (basic/uuencoded)
* authentification */
hdrs[4096]; /* optional arbitrary headers */
int use_html = 0; /* use html in the report */
char *tablestring;
-@@ -298,7 +300,7 @@
+@@ -299,7 +301,7 @@
struct data *stats; /* date for each request */
fd_set readbits, writebits; /* bits for select */
#ifndef BEOS
#define ab_close(s) close(s)
-@@ -509,7 +511,7 @@
+@@ -525,7 +527,7 @@
printf("\r \r");
printf("Server Software: %s\n", servername);
printf("Server Hostname: %s\n", hostname);
printf("\n");
printf("Document Path: %s\n", path);
printf("Document Length: %d bytes\n", doclen);
-@@ -862,7 +864,7 @@
+@@ -878,7 +880,7 @@
c->cbx = 0;
c->gotheader = 0;
+ c->fd = socket(server.ss_family, SOCK_STREAM, 0);
if (c->fd < 0) {
what = "SOCKET";
- goto bad;
-@@ -879,7 +881,12 @@
+ goto _bad;
+@@ -895,7 +897,12 @@
again:
gettimeofday(&c->start, 0);
+ if (connect(c->fd, (struct sockaddr *) & server, server.ss_len) < 0)
+#endif
+ {
- if (errno == EINPROGRESS) {
- c->state = STATE_CONNECTING;
- }
-@@ -1171,7 +1178,7 @@
+ if (errno != EINPROGRESS) {
+ what = "CONNECT";
+ goto _bad;
+@@ -1182,7 +1189,7 @@
struct timeval timeout, now;
fd_set sel_read, sel_except, sel_write;
long i;
- int connectport;
+ char * connectport;
- char * url_on_request, * host;
+ char * connecthost;
+ char * url_on_request;
- /* There are four hostname's involved:
-@@ -1209,16 +1216,21 @@
+@@ -1225,17 +1232,21 @@
}
{
/* get server information */
- struct hostent *he;
-- he = gethostbyname(host);
+- he = gethostbyname(connecthost);
- if (!he) {
- char theerror[1024];
-- sprintf(theerror, "Bad hostname: %s\n", host);
+- ap_snprintf(theerror, sizeof(theerror),
+- "Bad hostname: %s\n", connecthost);
- err(theerror);
- }
- server.sin_family = he->h_addrtype;
- server.sin_port = htons(connectport);
- server.sin_addr.s_addr = ((unsigned long *) (he->h_addr_list[0]))[0];
-+ struct addrinfo hints, *res;
++ struct addrinfo hints, *res;
+ int error;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
-+ error = getaddrinfo(host, connectport, &hints, &res);
++ error = getaddrinfo(connecthost, connectport, &hints, &res);
+ if (error) {
-+ char *theerror=malloc(strlen(host)+16);
-+ sprintf(theerror, "Bad hostname: %s\n", host);
++ char *theerror=malloc(strlen(connecthost)+16);
++ sprintf(theerror, "Bad hostname: %s\n", connecthost);
+ err(theerror);
+ free(theerror);
+ }
}
con = malloc(concurrency * sizeof(struct connection));
-@@ -1404,7 +1416,7 @@
+@@ -1423,7 +1434,7 @@
if (strlen(purl) > 8 && strncmp(purl, "https://", 8) == 0) {
purl += 8;
ssl = 1;
}
#else
if (strlen(purl) > 8 && strncmp(purl, "https://", 8) == 0) {
-@@ -1425,7 +1437,7 @@
+@@ -1444,15 +1455,15 @@
*cp = '\0';
strcpy(hostname, h);
if (p != NULL)
- port = atoi(p);
-+ port = strdup(p);
- return 0;
- }
++ port = strdup(p);
-@@ -1585,7 +1597,7 @@
+ if ((
+ #ifdef USE_SSL
+- (ssl != 0) && (port != 443)) || ((ssl == 0) &&
++ (ssl != 0) && (strcmp(port, "443"))) || ((ssl == 0) &&
+ #endif
+- (port != 80)))
++ (strcmp(port, "80"))))
+ {
+- ap_snprintf(colonport,sizeof(colonport),":%d",port);
++ ap_snprintf(colonport,sizeof(colonport),":%s",port);
+ } else {
+ colonport[0] = '\0';
+ }
+@@ -1615,7 +1626,7 @@
if ((p = strchr(optarg, ':'))) {
*p = '\0';
p++;
};
strcpy(proxyhost, optarg);
isproxy = 1;
-@@ -1668,3 +1680,7 @@
+@@ -1698,3 +1709,7 @@
exit(0);
}
+#ifdef NEED_GETADDRINFO
+#include "../main/getaddrinfo.c"
+#endif
-diff -Nur apache_1.3.23.orig/src/support/logresolve.c apache_1.3.23/src/support/logresolve.c
---- apache_1.3.23.orig/src/support/logresolve.c Wed May 23 00:52:21 2001
-+++ apache_1.3.23/src/support/logresolve.c Wed Feb 6 20:20:48 2002
+diff -Nur apache_1.3.26.orig/src/support/logresolve.c apache_1.3.26/src/support/logresolve.c
+--- apache_1.3.26.orig/src/support/logresolve.c Wed May 23 00:52:21 2001
++++ apache_1.3.26/src/support/logresolve.c Wed Jun 19 10:26:32 2002
@@ -54,7 +54,9 @@
#endif /* BEOS */
#endif /* !MPE && !WIN32*/