##
## Annotated patch file: eapi.patch
## Copyright (c) 1998-2001 Ralf S. Engelschall, All Rights Reserved.
-## Created on: 20-May-2001
+## Created on: 01-Feb-2002
##
## This file assembles changes to existing Apache source files
## between the original Apache and the patched variant. It can be
| patches and configured the shared memory support via the MM library.
+---------------------------------------------------------------------------
Index: src/Configuration.tmpl
---- src/Configuration.tmpl 1999/08/17 11:21:38 1.1.1.5
-+++ src/Configuration.tmpl 2000/10/09 12:15:02 1.21
+--- src/Configuration.tmpl 2002/01/28 19:21:21 1.1.1.7
++++ src/Configuration.tmpl 2002/01/28 19:40:56 1.23
@@ -68,6 +105,24 @@
#TARGET=
| Patch in implementation of the EAPI rule.
+---------------------------------------------------------------------------
Index: src/Configure
---- src/Configure 2001/05/20 08:16:15 1.1.1.15
-+++ src/Configure 2001/05/20 08:23:01 1.17
-@@ -1829,6 +1829,72 @@
+--- src/Configure 2002/01/28 19:21:21 1.1.1.17
++++ src/Configure 2002/01/28 19:40:56 1.19
+@@ -1866,6 +1866,72 @@
fi
####################################################################
+####################################################################
## Add in the Expat library if needed/wanted.
##
- if [ -d ./lib/expat-lite/ ]; then
+
+---------------------------------------------------------------------------
| Add the build support for the ap_hook.c and ap_ctx.c sources (Unix)
| Add the build support for the ap_hook.c and ap_ctx.c sources (Win32)
+---------------------------------------------------------------------------
Index: src/ap/ap.mak
---- src/ap/ap.mak 2001/05/20 08:16:15 1.1.1.8
-+++ src/ap/ap.mak 2001/05/20 08:23:01 1.8
-@@ -52,6 +52,9 @@
+--- src/ap/ap.mak 2001/10/16 11:47:06 1.1.1.9
++++ src/ap/ap.mak 2001/10/16 11:57:38 1.9
+@@ -50,6 +50,9 @@
-@erase "$(INTDIR)\ap_cpystrn.obj"
-@erase "$(INTDIR)\ap_fnmatch.obj"
-@erase "$(INTDIR)\ap_md5c.obj"
-@erase "$(INTDIR)\ap_sha1.obj"
-@erase "$(INTDIR)\ap_signal.obj"
-@erase "$(INTDIR)\ap_slack.obj"
-@@ -78,6 +81,9 @@
+@@ -108,6 +111,9 @@
"$(INTDIR)\ap_cpystrn.obj" \
"$(INTDIR)\ap_fnmatch.obj" \
"$(INTDIR)\ap_md5c.obj" \
"$(INTDIR)\ap_sha1.obj" \
"$(INTDIR)\ap_signal.obj" \
"$(INTDIR)\ap_slack.obj" \
-@@ -114,6 +120,9 @@
+@@ -144,6 +150,9 @@
-@erase "$(INTDIR)\ap_cpystrn.obj"
-@erase "$(INTDIR)\ap_fnmatch.obj"
-@erase "$(INTDIR)\ap_md5c.obj"
-@erase "$(INTDIR)\ap_sha1.obj"
-@erase "$(INTDIR)\ap_signal.obj"
-@erase "$(INTDIR)\ap_slack.obj"
-@@ -140,6 +149,9 @@
+@@ -202,6 +211,9 @@
"$(INTDIR)\ap_cpystrn.obj" \
"$(INTDIR)\ap_fnmatch.obj" \
"$(INTDIR)\ap_md5c.obj" \
| EAPI-aware modules and standard modules.
+---------------------------------------------------------------------------
Index: src/include/ap_mmn.h
---- src/include/ap_mmn.h 2001/01/23 11:35:07 1.1.1.8
-+++ src/include/ap_mmn.h 2001/01/23 11:48:05 1.8
-@@ -233,7 +233,23 @@
- * 19990320.10 - add ap_is_rdirectory() and ap_stripprefix()
+--- src/include/ap_mmn.h 2002/01/28 19:21:22 1.1.1.9
++++ src/include/ap_mmn.h 2002/01/28 19:40:56 1.9
+@@ -237,7 +237,23 @@
+ * structure
*/
+/*
| shared memory pools.
+---------------------------------------------------------------------------
Index: src/include/ap_alloc.h
---- src/include/ap_alloc.h 2001/02/28 19:40:47 1.1.1.3
-+++ src/include/ap_alloc.h 2001/02/28 19:44:33 1.4
+--- src/include/ap_alloc.h 2002/01/28 19:21:22 1.1.1.4
++++ src/include/ap_alloc.h 2002/01/28 19:40:56 1.5
@@ -95,6 +95,15 @@
- pool * ap_init_alloc(void); /* Set up everything */
+ API_EXPORT(pool *) ap_init_alloc(void); /* Set up everything */
void ap_cleanup_alloc(void);
API_EXPORT(pool *) ap_make_sub_pool(pool *); /* All pools are subpools of permanent_pool */
+#if defined(EAPI)
| Add the additional context variable `ctx' for BUFF structures.
+---------------------------------------------------------------------------
Index: src/include/buff.h
---- src/include/buff.h 2001/01/23 11:35:07 1.1.1.4
-+++ src/include/buff.h 2001/01/23 11:48:05 1.8
+--- src/include/buff.h 2002/01/28 19:21:23 1.1.1.5
++++ src/include/buff.h 2002/01/28 19:40:56 1.9
@@ -125,6 +125,10 @@
/* transport handle, for RPC binding handle or some such */
void *t_handle;
#ifdef B_SFIO
Sfio_t *sf_in;
Sfio_t *sf_out;
-@@ -176,6 +180,10 @@
+@@ -180,6 +184,10 @@
/* Internal routines */
API_EXPORT(int) ap_bflsbuf(int c, BUFF *fb);
API_EXPORT(int) ap_bfilbuf(BUFF *fb);
| Add the four additional Apache API module hooks.
+---------------------------------------------------------------------------
Index: src/include/http_config.h
---- src/include/http_config.h 2001/01/23 11:35:07 1.1.1.8
-+++ src/include/http_config.h 2001/01/23 11:48:05 1.10
+--- src/include/http_config.h 2002/01/28 19:21:23 1.1.1.9
++++ src/include/http_config.h 2002/01/28 19:40:56 1.11
@@ -276,6 +276,65 @@
void (*child_exit) (server_rec *, pool *);
#endif
| global module context.
+---------------------------------------------------------------------------
Index: src/include/http_conf_globals.h
---- src/include/http_conf_globals.h 2001/01/23 11:35:07 1.1.1.8
-+++ src/include/http_conf_globals.h 2001/01/23 11:48:05 1.9
-@@ -92,6 +92,9 @@
- extern int ap_listenbacklog;
+--- src/include/http_conf_globals.h 2002/01/28 19:21:22 1.1.1.10
++++ src/include/http_conf_globals.h 2002/01/28 19:40:56 1.11
+@@ -95,6 +95,9 @@
+ #endif
extern int ap_dump_settings;
extern API_VAR_EXPORT int ap_extended_status;
+#ifdef EAPI
| some modules need a generic timeout mechanism.
+---------------------------------------------------------------------------
Index: src/include/http_main.h
---- src/include/http_main.h 2001/01/23 11:35:07 1.1.1.5
-+++ src/include/http_main.h 2001/01/23 11:48:05 1.5
-@@ -125,7 +125,11 @@
- API_EXPORT(void) ap_sync_scoreboard_image(void);
- int ap_update_child_status(int child_num, int status, request_rec *r);
- void ap_time_process_request(int child_num, int status);
-+#ifdef EAPI
-+API_EXPORT(unsigned int) ap_set_callback_and_alarm(void (*fn) (int), int x);
-+#else
- unsigned int ap_set_callback_and_alarm(void (*fn) (int), int x);
-+#endif
- API_EXPORT(int) ap_check_alarm(void);
-
- void setup_signal_names(char *prefix);
+---------------------------------------------------------------------------
| First add support for the HTTPS protocol scheme via hooks,
| function.
+---------------------------------------------------------------------------
Index: src/include/httpd.h
---- src/include/httpd.h 2001/05/20 08:16:17 1.1.1.15
-+++ src/include/httpd.h 2001/05/20 08:23:02 1.25
+--- src/include/httpd.h 2002/01/28 19:21:23 1.1.1.17
++++ src/include/httpd.h 2002/01/28 19:40:56 1.27
@@ -70,7 +70,19 @@
/* Headers in which EVERYONE has an interest... */
#include "buff.h"
#include "ap.h"
-@@ -141,8 +153,13 @@
+@@ -141,12 +153,17 @@
#define DEFAULT_HTTP_PORT 80
#define DEFAULT_HTTPS_PORT 443
#define ap_is_default_port(port,r) ((port) == ap_default_port(r))
+#define ap_http_method(r) (((r)->ctx != NULL && ap_ctx_get((r)->ctx, "ap::http::method") != NULL) ? ((char *)ap_ctx_get((r)->ctx, "ap::http::method")) : "http")
+#define ap_default_port(r) (((r)->ctx != NULL && ap_ctx_get((r)->ctx, "ap::default::port") != NULL) ? atoi((char *)ap_ctx_get((r)->ctx, "ap::default::port")) : DEFAULT_HTTP_PORT)
+#else /* EAPI */
+ #ifdef NETWARE
+ #define ap_http_method(r) ap_os_http_method(r)
+ #else
#define ap_http_method(r) "http"
+ #endif
#define ap_default_port(r) DEFAULT_HTTP_PORT
+#endif /* EAPI */
/* --------- Default user name and group name running standalone ---------- */
/* --- These may be specified as numbers by placing a # before a number --- */
-@@ -356,6 +373,19 @@
+@@ -360,6 +377,19 @@
#define SCOREBOARD_MAINTENANCE_INTERVAL 1000000
#endif
/* Number of requests to try to handle in a single process. If <= 0,
* the children don't die off. That's the default here, since I'm still
* interested in finding and stanching leaks.
-@@ -448,6 +478,9 @@
+@@ -452,6 +482,9 @@
API_EXPORT(const char *) ap_get_server_version(void);
API_EXPORT(void) ap_add_version_component(const char *component);
API_EXPORT(const char *) ap_get_server_built(void);
/* Numeric release version identifier: MMNNFFRBB: major minor fix final beta
* Always increases along the same track as the source branch.
-@@ -851,6 +884,10 @@
+@@ -855,6 +888,10 @@
* record to improve 64bit alignment the next time we need to break
* binary compatibility for some other reason.
*/
};
-@@ -899,6 +936,9 @@
+@@ -903,6 +940,9 @@
char *local_host; /* used for ap_get_server_name when
* UseCanonicalName is set to DNS
* (ignores setting of HostnameLookups) */
};
/* Per-vhost config... */
-@@ -971,6 +1011,10 @@
+@@ -975,6 +1015,10 @@
int limit_req_line; /* limit on size of the HTTP request line */
int limit_req_fieldsize; /* limit on size of any request header field */
int limit_req_fields; /* limit on number of request header fields */
| Patch the shared memory pool support into the Apache pool facility.
+---------------------------------------------------------------------------
Index: src/main/alloc.c
---- src/main/alloc.c 2001/01/23 11:35:08 1.1.1.10
-+++ src/main/alloc.c 2001/01/23 11:48:05 1.17
+--- src/main/alloc.c 2002/01/28 19:21:24 1.1.1.11
++++ src/main/alloc.c 2002/01/28 19:40:56 1.18
@@ -64,6 +64,10 @@
*/
| modules to intercept the I/O processing via hooks.
+---------------------------------------------------------------------------
Index: src/main/buff.c
---- src/main/buff.c 2001/01/23 11:35:08 1.1.1.10
-+++ src/main/buff.c 2001/01/23 11:48:05 1.18
-@@ -127,7 +127,11 @@
- select() sometimes returns 1 even though the write will block. We must work around this.
- */
-
-+#ifdef EAPI
-+API_EXPORT(int) sendwithtimeout(int sock, const char *buf, int len, int flags)
-+#else /* EAPI */
- int sendwithtimeout(int sock, const char *buf, int len, int flags)
-+#endif /* EAPI */
- {
- int iostate = 1;
- fd_set fdset;
-@@ -195,8 +199,11 @@
- return (rv);
- }
-
--
-+#ifdef EAPI
-+API_EXPORT(int) recvwithtimeout(int sock, char *buf, int len, int flags)
-+#else /* EAPI */
- int recvwithtimeout(int sock, char *buf, int len, int flags)
-+#endif /* EAPI */
- {
- int iostate = 1;
- fd_set fdset;
-@@ -274,6 +281,9 @@
+--- src/main/buff.c 2002/01/28 19:21:24 1.1.1.11
++++ src/main/buff.c 2002/01/28 19:40:57 1.19
+@@ -273,6 +273,9 @@
}
else
#endif
rv = read(fb->fd_in, buf, nbyte);
return rv;
-@@ -285,6 +295,9 @@
+@@ -284,6 +287,9 @@
- #if defined (WIN32) || defined(NETWARE)
+ #if defined (WIN32) || defined(NETWARE) || defined(CYGWIN_WINSOCK)
if (fb->flags & B_SOCKET) {
+#ifdef EAPI
+ if (!ap_hook_call("ap::buff::recvwithtimeout", &rv, fb, buf, nbyte))
+#endif /* EAPI */
- rv = recvwithtimeout(fb->fd_in, buf, nbyte, 0);
+ rv = ap_recvwithtimeout(fb->fd_in, buf, nbyte, 0);
if (rv == SOCKET_ERROR)
errno = WSAGetLastError();
-@@ -332,6 +345,9 @@
+@@ -331,6 +337,9 @@
}
else
#endif
#if defined (B_SFIO)
rv = sfwrite(fb->sf_out, buf, nbyte);
#else
-@@ -358,6 +374,9 @@
-
+@@ -361,6 +370,9 @@
+
#if defined(WIN32) || defined(NETWARE)
if (fb->flags & B_SOCKET) {
+#ifdef EAPI
+ if (!ap_hook_call("ap::buff::sendwithtimeout", &rv, fb, buf, nbyte))
+#endif /* EAPI */
- rv = sendwithtimeout(fb->fd, buf, nbyte, 0);
+ rv = ap_sendwithtimeout(fb->fd, buf, nbyte, 0);
if (rv == SOCKET_ERROR)
errno = WSAGetLastError();
-@@ -438,6 +457,10 @@
- (size_t) SF_UNBOUND, 1, SF_WRITE);
- #endif
+@@ -444,6 +456,10 @@
+ fb->callback_data = NULL;
+ fb->filter_callback = NULL;
+#ifdef EAPI
+ fb->ctx = ap_ctx_new(p);
return fb;
}
-@@ -1084,6 +1107,9 @@
+@@ -1096,6 +1112,9 @@
i = 0;
while (i < nvec) {
do
| variables are initialized.
+---------------------------------------------------------------------------
Index: src/main/http_config.c
---- src/main/http_config.c 2001/01/29 19:36:42 1.1.1.11
-+++ src/main/http_config.c 2001/01/29 19:38:39 1.14
+--- src/main/http_config.c 2002/01/28 19:21:24 1.1.1.13
++++ src/main/http_config.c 2002/01/28 19:40:57 1.16
@@ -599,6 +599,20 @@
m->name = tmp;
}
| is added plus the initialization of one more `ctx' variable.
+---------------------------------------------------------------------------
Index: src/main/http_main.c
---- src/main/http_main.c 2001/05/20 08:16:18 1.1.1.14
-+++ src/main/http_main.c 2001/05/20 08:23:02 1.36
-@@ -260,6 +260,9 @@
- int ap_listenbacklog;
+--- src/main/http_main.c 2002/01/28 19:21:24 1.1.1.16
++++ src/main/http_main.c 2002/01/28 19:40:57 1.38
+@@ -279,6 +279,9 @@
+
int ap_dump_settings = 0;
API_VAR_EXPORT int ap_extended_status = 0;
+#ifdef EAPI
/*
* The max child slot ever assigned, preserved across restarts. Necessary
-@@ -442,6 +445,30 @@
+@@ -461,6 +464,30 @@
}
}
#ifndef NETWARE
static APACHE_TLS int volatile exit_after_unblock = 0;
#endif
-@@ -1209,6 +1236,10 @@
+@@ -1509,6 +1536,10 @@
ap_log_transaction(log_req);
}
ap_bsetflag(save_req->connection->client, B_EOUT, 1);
ap_bclose(save_req->connection->client);
-@@ -1217,6 +1248,9 @@
+@@ -1517,6 +1548,9 @@
ap_longjmp(jmpbuffer, 1);
}
else { /* abort the connection */
ap_bsetflag(current_conn->client, B_EOUT, 1);
ap_bclose(current_conn->client);
current_conn->aborted = 1;
-@@ -1282,7 +1316,11 @@
- }
- #endif
-
-+#ifdef EAPI
-+API_EXPORT(unsigned int) ap_set_callback_and_alarm(void (*fn) (int), int x)
-+#else
- unsigned int ap_set_callback_and_alarm(void (*fn) (int), int x)
-+#endif
- {
- unsigned int old;
-
-@@ -1518,10 +1556,16 @@
+@@ -1818,10 +1852,16 @@
/* Send any leftover data to the client, but never try to again */
if (ap_bflush(r->connection->client) == -1) {
ap_bsetflag(r->connection->client, B_EOUT, 1);
/* Close our half of the connection --- send the client a FIN */
-@@ -2232,6 +2276,9 @@
+@@ -2549,6 +2589,9 @@
/* Clear the pool - including any registered cleanups */
ap_destroy_pool(pglobal);
#endif
exit(code);
}
-@@ -3226,6 +3273,24 @@
+@@ -3544,7 +3587,25 @@
conn->remote_addr = *remaddr;
conn->remote_ip = ap_pstrdup(conn->pool,
inet_ntoa(conn->remote_addr.sin_addr));
+#ifdef EAPI
+ conn->ctx = ap_ctx_new(conn->pool);
+#endif /* EAPI */
-+
+
+#ifdef EAPI
+ /*
+ * Invoke the `new_connection' hook of modules to let them do
+ (*m->new_connection)(conn);
+ }
+#endif /* EAPI */
-
++
return conn;
}
-@@ -3648,6 +3713,15 @@
+
+@@ -3972,6 +4033,15 @@
printf("Server's Module Magic Number: %u:%u\n",
MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR);
printf("Server compiled with....\n");
+ printf(" -D EAPI_MM_CORE_PATH=\"" EAPI_MM_CORE_PATH "\"\n");
+#endif
+#endif
- #ifdef BIG_SECURITY_HOLE
- printf(" -D BIG_SECURITY_HOLE\n");
+ #ifdef TPF
+ show_os_specific_compile_settings();
#endif
-@@ -3801,6 +3875,22 @@
+@@ -4144,6 +4214,22 @@
ap_server_pre_read_config = ap_make_array(pcommands, 1, sizeof(char *));
ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *));
ap_server_config_defines = ap_make_array(pcommands, 1, sizeof(char *));
}
#ifndef MULTITHREAD
-@@ -4220,6 +4310,9 @@
+@@ -4576,6 +4662,9 @@
ap_sync_scoreboard_image();
if (ap_scoreboard_image->global.running_generation != ap_my_generation) {
ap_bclose(conn_io);
clean_child_exit(0);
}
-@@ -4248,6 +4341,9 @@
+@@ -4604,6 +4693,9 @@
*/
#ifdef NO_LINGCLOSE
ap_bclose(conn_io); /* just close it */
#else
if (r && r->connection
-@@ -4258,6 +4354,9 @@
+@@ -4614,6 +4706,9 @@
lingering_close(r);
}
else {
ap_bsetflag(conn_io, B_EOUT, 1);
ap_bclose(conn_io);
}
-@@ -4982,16 +5081,31 @@
+@@ -5373,16 +5468,31 @@
usage(argv[0]);
}
}
}
child_timeouts = !ap_standalone || one_process;
-@@ -5121,6 +5235,10 @@
+@@ -5513,6 +5623,10 @@
ap_destroy_pool(r->pool);
}
ap_bclose(cio);
}
exit(0);
-@@ -5467,6 +5585,9 @@
+@@ -5889,6 +6003,9 @@
ap_kill_cleanups_for_socket(ptrans, csd);
#ifdef NO_LINGCLOSE
ap_bclose(conn_io); /* just close it */
#else
if (r && r->connection
-@@ -5477,6 +5598,9 @@
+@@ -5899,6 +6016,9 @@
lingering_close(r);
}
else {
ap_bsetflag(conn_io, B_EOUT, 1);
ap_bclose(conn_io);
}
-@@ -7002,6 +7126,10 @@
+@@ -7444,6 +7564,10 @@
if (!conf_specified)
ap_cpystrn(ap_server_confname, SERVER_CONFIG_FILE, sizeof(ap_server_confname));
if (!ap_os_is_path_absolute(ap_server_confname))
ap_cpystrn(ap_server_confname,
ap_server_root_relative(pcommands, ap_server_confname),
-@@ -7043,6 +7171,9 @@
+@@ -7483,6 +7607,9 @@
}
#else /* ndef WIN32 */
server_conf = ap_read_config(pconf, ptrans, ap_server_confname);
| conn_rec structures.
+---------------------------------------------------------------------------
Index: src/main/http_request.c
---- src/main/http_request.c 2001/05/20 08:16:18 1.1.1.12
-+++ src/main/http_request.c 2001/05/20 08:23:02 1.12
-@@ -1374,6 +1374,10 @@
+--- src/main/http_request.c 2002/01/28 19:21:25 1.1.1.13
++++ src/main/http_request.c 2002/01/28 19:40:57 1.13
+@@ -1375,6 +1375,10 @@
new->method = r->method;
new->method_number = r->method_number;
| request_rec structures.
+---------------------------------------------------------------------------
Index: src/main/http_protocol.c
---- src/main/http_protocol.c 2001/05/20 08:16:18 1.1.1.13
-+++ src/main/http_protocol.c 2001/05/20 08:23:02 1.13
-@@ -1110,6 +1110,10 @@
+--- src/main/http_protocol.c 2002/01/28 19:21:25 1.1.1.15
++++ src/main/http_protocol.c 2002/01/28 19:40:57 1.15
+@@ -1151,6 +1151,10 @@
r->status = HTTP_REQUEST_TIME_OUT; /* Until we get a request */
r->the_request = NULL;
#ifdef CHARSET_EBCDIC
ap_bsetflag(r->connection->client, B_ASCII2EBCDIC, r->ebcdic.conv_in = 1);
ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, r->ebcdic.conv_out = 1);
-@@ -1258,6 +1262,11 @@
+@@ -1299,6 +1303,11 @@
rnew->read_body = REQUEST_NO_BODY;
rnew->main = (request_rec *) r;
+
}
- void ap_finalize_sub_req_protocol(request_rec *sub)
+ API_EXPORT(void) ap_finalize_sub_req_protocol(request_rec *sub)
+---------------------------------------------------------------------------
| Add support for loading both EAPI and AP13 modules.
+---------------------------------------------------------------------------
Index: src/modules/standard/mod_so.c
---- src/modules/standard/mod_so.c 2001/05/20 08:16:21 1.1.1.7
-+++ src/modules/standard/mod_so.c 2001/05/20 08:23:02 1.8
-@@ -266,11 +266,24 @@
+--- src/modules/standard/mod_so.c 2002/01/28 19:21:28 1.1.1.8
++++ src/modules/standard/mod_so.c 2002/01/28 19:40:57 1.9
+@@ -269,11 +269,24 @@
* Make sure the found module structure is really a module structure
*
*/
| variables from other modules.
+---------------------------------------------------------------------------
Index: src/modules/standard/mod_rewrite.c
---- src/modules/standard/mod_rewrite.c 2001/05/20 08:16:21 1.1.1.11
-+++ src/modules/standard/mod_rewrite.c 2001/05/20 08:23:02 1.9
+--- src/modules/standard/mod_rewrite.c 2002/01/28 19:21:27 1.1.1.13
++++ src/modules/standard/mod_rewrite.c 2002/01/28 19:40:57 1.11
@@ -3678,6 +3678,15 @@
}
#endif /* ndef WIN32 && NETWARE*/
| the status HTML page.
+---------------------------------------------------------------------------
Index: src/modules/standard/mod_status.c
---- src/modules/standard/mod_status.c 2001/05/20 08:16:21 1.1.1.12
-+++ src/modules/standard/mod_status.c 2001/05/20 08:23:02 1.9
-@@ -715,6 +752,12 @@
+--- src/modules/standard/mod_status.c 2002/01/28 19:21:28 1.1.1.13
++++ src/modules/standard/mod_status.c 2002/01/28 19:40:57 1.10
+@@ -717,6 +754,12 @@
</table>\n", r);
#endif
}
| recognize more schemes by intercepting this processing.
+---------------------------------------------------------------------------
Index: src/modules/proxy/mod_proxy.c
---- src/modules/proxy/mod_proxy.c 2001/01/23 11:35:10 1.1.1.8
-+++ src/modules/proxy/mod_proxy.c 2001/01/23 11:48:07 1.15
+--- src/modules/proxy/mod_proxy.c 2002/01/28 19:21:26 1.1.1.10
++++ src/modules/proxy/mod_proxy.c 2002/01/28 19:40:57 1.17
@@ -215,6 +215,9 @@
static int proxy_fixup(request_rec *r)
{
+#endif /* EAPI */
if (r->proxyreq == NOT_PROXY || strncmp(r->filename, "proxy:", 6) != 0)
- return DECLINED;
+ return DECLINED;
@@ -222,6 +225,14 @@
url = &r->filename[6];
+ else
+#endif /* EAPI */
if (strncasecmp(url, "http:", 5) == 0)
- return ap_proxy_http_canon(r, url + 5, "http", DEFAULT_HTTP_PORT);
+ return ap_proxy_http_canon(r, url + 5, "http", DEFAULT_HTTP_PORT);
else if (strncasecmp(url, "ftp:", 4) == 0)
@@ -237,9 +248,44 @@
static void proxy_init(server_rec *r, pool *p)
+ AP_HOOK_SIG3(void,ptr,ptr), AP_HOOK_ALL, r, p);
+#endif
}
--
+-
+#ifdef EAPI
+static void proxy_addmod(module *m)
+{
/* Send a redirection if the request contains a hostname which is not */
/* fully qualified, i.e. doesn't have a domain name appended. Some proxy */
-@@ -369,6 +415,14 @@
- /* CONNECT is a special method that bypasses the normal
- * proxy code.
- */
+@@ -370,6 +416,14 @@
+ /* CONNECT is a special method that bypasses the normal
+ * proxy code.
+ */
+#ifdef EAPI
+ if (!ap_hook_use("ap::mod_proxy::handler",
+ AP_HOOK_SIG7(int,ptr,ptr,ptr,ptr,int,ptr),
+ ents[i].hostname, ents[i].port,
+ ents[i].protocol) || rc == DECLINED) {
+#endif /* EAPI */
- if (r->method_number == M_CONNECT)
- rc = ap_proxy_connect_handler(r, cr, url, ents[i].hostname,
- ents[i].port);
-@@ -378,6 +432,9 @@
- ents[i].port);
- else
- rc = DECLINED;
+ if (r->method_number == M_CONNECT)
+ rc = ap_proxy_connect_handler(r, cr, url, ents[i].hostname,
+ ents[i].port);
+@@ -379,6 +433,9 @@
+ ents[i].port);
+ else
+ rc = DECLINED;
+#ifdef EAPI
+ }
+#endif /* EAPI */
- /* an error or success */
- if (rc != DECLINED && rc != HTTP_BAD_GATEWAY)
-@@ -391,6 +448,14 @@
+ /* an error or success */
+ if (rc != DECLINED && rc != HTTP_BAD_GATEWAY)
+@@ -392,6 +449,14 @@
* give up??
*/
/* handle the scheme */
+ return rc;
+#endif /* EAPI */
if (r->method_number == M_CONNECT)
- return ap_proxy_connect_handler(r, cr, url, NULL, 0);
+ return ap_proxy_connect_handler(r, cr, url, NULL, 0);
if (strcasecmp(scheme, "http") == 0)
-@@ -955,6 +1020,12 @@
- NULL, /* child_init */
- NULL, /* child_exit */
- proxy_detect /* post read-request */
+@@ -956,6 +1021,12 @@
+ NULL, /* child_init */
+ NULL, /* child_exit */
+ proxy_detect /* post read-request */
+#ifdef EAPI
+ ,proxy_addmod, /* EAPI: add_module */
+ proxy_remmod, /* EAPI: remove_module */
| to enhance it by intercepting this processing.
+---------------------------------------------------------------------------
Index: src/modules/proxy/proxy_http.c
---- src/modules/proxy/proxy_http.c 2001/02/28 19:40:51 1.1.1.10
-+++ src/modules/proxy/proxy_http.c 2001/02/28 19:44:34 1.18
-@@ -190,6 +190,9 @@
+--- src/modules/proxy/proxy_http.c 2002/01/28 19:21:26 1.1.1.12
++++ src/modules/proxy/proxy_http.c 2002/01/28 19:40:57 1.20
+@@ -166,6 +166,9 @@
+ char *destportstr = NULL;
const char *urlptr = NULL;
- const char *datestr;
- struct tbl_do_args tdo;
+ const char *datestr, *urlstr;
+#ifdef EAPI
+ char *peer;
+#endif
void *sconf = r->server->module_config;
proxy_server_conf *conf =
-@@ -208,6 +211,12 @@
- return HTTP_BAD_REQUEST;
+@@ -186,6 +189,12 @@
+ return HTTP_BAD_REQUEST;
urlptr += 3;
destport = DEFAULT_HTTP_PORT;
+#ifdef EAPI
+#endif /* EAPI */
strp = strchr(urlptr, '/');
if (strp == NULL) {
- desthost = ap_pstrdup(p, urlptr);
-@@ -245,12 +254,18 @@
- err = ap_proxy_host2addr(proxyhost, &server_hp);
- if (err != NULL)
- return DECLINED; /* try another */
+ desthost = ap_pstrdup(p, urlptr);
+@@ -223,12 +232,18 @@
+ err = ap_proxy_host2addr(proxyhost, &server_hp);
+ if (err != NULL)
+ return DECLINED; /* try another */
+#ifdef EAPI
+ peer = ap_psprintf(p, "%s:%u", proxyhost, proxyport);
+#endif
}
else {
- server.sin_port = htons(destport);
- err = ap_proxy_host2addr(desthost, &server_hp);
- if (err != NULL)
- return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR, err);
+ server.sin_port = htons((unsigned short)destport);
+ err = ap_proxy_host2addr(desthost, &server_hp);
+ if (err != NULL)
+ return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR, err);
+#ifdef EAPI
+ peer = ap_psprintf(p, "%s:%u", desthost, destport);
+#endif
}
- sock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
-@@ -307,13 +322,41 @@
+
+@@ -301,14 +316,42 @@
f = ap_bcreate(p, B_RDWR | B_SOCKET);
ap_bpushfd(f, sock, sock);
+
ap_hard_timeout("proxy send", r);
ap_bvputs(f, r->method, " ", proxyhost ? url : urlptr, " HTTP/1.0" CRLF,
- NULL);
+ NULL);
+#ifdef EAPI
+ {
+ int rc = DECLINED;
+ }
+ }
+#else /* EAPI */
+ /* Send Host: now, adding it to req_hdrs wouldn't be much better */
if (destportstr != NULL && destport != DEFAULT_HTTP_PORT)
- ap_bvputs(f, "Host: ", desthost, ":", destportstr, CRLF, NULL);
+ ap_bvputs(f, "Host: ", desthost, ":", destportstr, CRLF, NULL);
else
- ap_bvputs(f, "Host: ", desthost, CRLF, NULL);
+ ap_bvputs(f, "Host: ", desthost, CRLF, NULL);
+#endif /* EAPI */
if (conf->viaopt == via_block) {
- /* Block all outgoing Via: headers */
+ /* Block all outgoing Via: headers */
+---------------------------------------------------------------------------
| Add EAPI hooks in module structure for APXS generated samples.
| Windows 95 and similar braindead platforms as DDL.
+---------------------------------------------------------------------------
Index: src/ApacheCore.def
---- src/ApacheCore.def 2001/01/23 11:35:01 1.1.1.7
-+++ src/ApacheCore.def 2001/03/03 10:46:41 1.11
-@@ -389,3 +389,69 @@
- ap_stripprefix @380
- ap_os_dso_load @381
- ap_os_dso_error @382
+--- src/ApacheCore.def 2002/01/28 19:21:21 1.1.1.8
++++ src/ApacheCore.def 2002/01/28 19:40:56 1.12
+@@ -442,3 +442,67 @@
+ ap_update_child_status @434
+ ap_sendwithtimeout @435
+ ap_recvwithtimeout @436
+
+ ; EAPI extended symbols
+ ; note; no ID's, so these all bind by name rather than ordinal since
+ ap_hook_use
+ ap_hook_call
+ ap_set_callback_and_alarm
-+ recvwithtimeout
-+ sendwithtimeout
+ ap_acquire_pool
+ ap_make_shared_sub_pool
+ ap_release_pool