You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by be...@hyperreal.org on 1999/07/22 21:17:27 UTC
cvs commit: apache-2.0/mpm/src/main http_connection.c http_core.c http_request.c
ben 99/07/22 12:17:26
Modified: mpm/src/include ap_hooks.h http_connection.h
mpm/src/main http_connection.c http_core.c http_request.c
Log:
And with one bound, he was free! This seemingly minor change allows modules
to take over connection processing, thus making Apache multiprotocol. Woo!
Revision Changes Path
1.8 +4 -1 apache-2.0/mpm/src/include/ap_hooks.h
Index: ap_hooks.h
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ap_hooks.h 1999/07/11 16:54:02 1.7
+++ ap_hooks.h 1999/07/22 19:17:15 1.8
@@ -60,8 +60,11 @@
return rv_final; \
}
+/* RUN_ALL runs to the first one to return other than ok or decline
+ RUN_FIRST runs to the first one to return other than ok
+*/
#define RUN_ALL 1
-#define RUN_TO_FIRST_ERROR 0
+#define RUN_FIRST 0
#define IMPLEMENT_HOOK(ret,name,args,args2,run_all,ok,decline) \
IMPLEMENT_HOOK_BASE(ret,ret r_;,r_=,r_,name,args,args2,run_all,r_ != decline,r_ != ok,run_all ? ok : decline)
1.5 +2 -0 apache-2.0/mpm/src/include/http_connection.h
Index: http_connection.h
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_connection.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- http_connection.h 1999/07/05 13:00:42 1.4
+++ http_connection.h 1999/07/22 19:17:16 1.5
@@ -69,9 +69,11 @@
const struct sockaddr_in *saddr,
int child_num, int thread_num);
CORE_EXPORT(void) ap_process_connection(conn_rec *);
+int ap_process_http_connection(conn_rec *);
/* Hooks */
DECLARE_HOOK(void,pre_connection,(conn_rec *))
+DECLARE_HOOK(int,process_connection,(conn_rec *))
#ifdef __cplusplus
}
1.11 +12 -3 apache-2.0/mpm/src/main/http_connection.c
Index: http_connection.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_connection.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- http_connection.c 1999/07/11 16:42:24 1.10
+++ http_connection.c 1999/07/22 19:17:21 1.11
@@ -66,9 +66,11 @@
HOOK_STRUCT(
HOOK_LINK(pre_connection)
+ HOOK_LINK(process_connection)
);
IMPLEMENT_VOID_HOOK(pre_connection,(conn_rec *c),(c),RUN_ALL)
+IMPLEMENT_HOOK(int,process_connection,(conn_rec *c),(c),RUN_FIRST,OK,DECLINED)
/* TODO: re-implement the lingering close stuff */
#define NO_LINGCLOSE
@@ -190,12 +192,17 @@
CORE_EXPORT(void) ap_process_connection(conn_rec *c)
{
- request_rec *r;
-
ap_update_vhost_given_ip(c);
ap_run_pre_connection(c);
+ ap_run_process_connection(c);
+}
+
+int ap_process_http_connection(conn_rec *c)
+ {
+ request_rec *r;
+
/*
* Read and process each request found on our connection
* until no requests are left or we decide to close.
@@ -216,7 +223,7 @@
if (ap_graceful_stop_signalled()) {
/* XXX: hey wait, this should do a lingering_close! */
ap_bclose(c->client);
- return;
+ return OK;
}
}
@@ -241,6 +248,8 @@
ap_bclose(c->client);
}
#endif
+
+ return OK;
}
/* Clearly some of this stuff doesn't belong in a generalised connection
1.8 +3 -0 apache-2.0/mpm/src/main/http_core.c
Index: http_core.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- http_core.c 1999/07/17 10:35:40 1.7
+++ http_core.c 1999/07/22 19:17:22 1.8
@@ -67,6 +67,7 @@
#include "rfc1413.h"
#include "util_md5.h"
#include "fnmatch.h"
+#include "http_connection.h"
#ifdef USE_MMAP_FILES
#include <sys/mman.h>
@@ -2632,6 +2633,8 @@
static void register_hooks()
{
ap_hook_translate_name(core_translate,NULL,NULL,HOOK_REALLY_LAST);
+ ap_hook_process_connection(ap_process_http_connection,NULL,NULL,
+ HOOK_REALLY_LAST);
}
API_VAR_EXPORT module core_module = {
1.12 +2 -4 apache-2.0/mpm/src/main/http_request.c
Index: http_request.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- http_request.c 1999/07/17 10:35:42 1.11
+++ http_request.c 1999/07/22 19:17:23 1.12
@@ -83,10 +83,8 @@
HOOK_LINK(check_user_id)
)
-IMPLEMENT_HOOK(int,translate_name,(request_rec *r),(r),RUN_TO_FIRST_ERROR,OK,
- DECLINED)
-IMPLEMENT_HOOK(int,check_user_id,(request_rec *r),(r),RUN_TO_FIRST_ERROR,OK,
- DECLINED)
+IMPLEMENT_HOOK(int,translate_name,(request_rec *r),(r),RUN_FIRST,OK,DECLINED)
+IMPLEMENT_HOOK(int,check_user_id,(request_rec *r),(r),RUN_FIRST,OK,DECLINED)
/*****************************************************************
*