]> git.pld-linux.org Git - packages/apache1.git/blame - apache1-lingerd.patch
rel 15; builds
[packages/apache1.git] / apache1-lingerd.patch
CommitLineData
cefc01b3
ER
1
2# This is a patch to make lingerd work with Apache and mod_ssl together.
3#
4# Installation instructions:
5#
6# 1) untar apache, mod_ssl and lingerd
7#
8# 2) install mod_ssl, per the instructions in mod_ssl_2.x/INSTALL,
9# using "the flexible APACI-only way", which copies files over into
10# apache's source tree, but doesn't compile Apache just yet.
11#
12# 3) install lingerd per the instructions in lingerd-0.9x/INSTALL.
13# when patching the Apache source, use aplinger-ssl.diff (this file)
14# instead of the regular apache-1.3/aplinger.diff.
15#
16
35b2c95a
AM
17diff -urNp -x '*.orig' apache_1.3.42.org/src/main/Makefile.tmpl apache_1.3.42/src/main/Makefile.tmpl
18--- apache_1.3.42.org/src/main/Makefile.tmpl 2004-11-24 20:10:19.000000000 +0100
19+++ apache_1.3.42/src/main/Makefile.tmpl 2023-02-02 22:44:19.209834916 +0100
20@@ -5,13 +5,13 @@ INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXT
cefc01b3
ER
21 LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
22
23 LIB= libmain.a
24-HEADERS= test_char.h uri_delims.h
25+HEADERS= test_char.h uri_delims.h li_config.h
26
27 OBJS= alloc.o buff.o \
28 http_config.o http_core.o http_log.o \
29 http_main.o http_protocol.o http_request.o http_vhost.o \
30 util.o util_date.o util_script.o util_uri.o util_md5.o \
31- rfc1413.o
32+ rfc1413.o ap_lingerd.o
33
34 .c.o:
35 $(CC) -c $(INCLUDES) $(CFLAGS) $<
35b2c95a
AM
36diff -urNp -x '*.orig' apache_1.3.42.org/src/main/http_main.c apache_1.3.42/src/main/http_main.c
37--- apache_1.3.42.org/src/main/http_main.c 2023-02-02 22:44:18.889834915 +0100
38+++ apache_1.3.42/src/main/http_main.c 2023-02-02 22:44:19.213168249 +0100
39@@ -60,6 +60,10 @@ int ap_main(int argc, char *argv[]);
cefc01b3
ER
40 #include "http_vhost.h"
41 #include "util_script.h" /* to force util_script.c linking */
42 #include "util_uri.h"
43+#define IN_APACHE
44+#include "li_config.h"
99afd3d1
JB
45+void lingerd_connect(void);
46+int lingerd_sendfd(int);
cefc01b3
ER
47 #include "scoreboard.h"
48 #include "multithread.h"
49 #include <sys/stat.h>
35b2c95a 50@@ -1993,6 +1997,19 @@ static void lingering_close(request_rec
cefc01b3
ER
51 return;
52 }
53
54+ /*
55+ * Try to feed the socket to the linger daemon. If it fails and
56+ * we're configured to do so, do a lingering close anyway.
57+ * Otherwise just close the socket; lingerd will linger on its copy
58+ * of it.
59+ */
60+
61+ if (lingerd_sendfd(lsd) == 0 || !(LINGER_ON_FAILURE)) {
62+ ap_bclose(r->connection->client);
63+ ap_kill_timeout(r);
64+ return;
65+ }
66+
67 /* Set up to wait for readable data on socket... */
68
69 FD_ZERO(&lfds);
35b2c95a
AM
70@@ -4538,6 +4555,8 @@ static void common_init(void)
71 ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *));
cefc01b3 72 ap_server_config_defines = ap_make_array(pcommands, 1, sizeof(char *));
cefc01b3 73
09585c5b
ER
74+ lingerd_connect();
75+
cefc01b3
ER
76 #ifdef EAPI
77 ap_hook_init();
09585c5b 78 ap_hook_configure("ap::buff::read",
This page took 0.101024 seconds and 4 git commands to generate.