From: Ben Laurie Date: Mon, 5 Jul 1999 13:00:45 +0000 (+0000) Subject: Strawman hooks implementation (beginning of). X-Git-Tag: 1.3.7~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=529108e58a44252ac0d7d502334958e52ef15f6e;p=thirdparty%2Fapache%2Fhttpd.git Strawman hooks implementation (beginning of). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83434 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/http_connection.h b/include/http_connection.h index 95657a15ebf..90f284133c2 100644 --- a/include/http_connection.h +++ b/include/http_connection.h @@ -58,6 +58,8 @@ #ifndef APACHE_HTTP_CONNECTION_H #define APACHE_HTTP_CONNECTION_H +#include "ap_hooks.h" + #ifdef __cplusplus extern "C" { #endif @@ -68,6 +70,9 @@ conn_rec *ap_new_connection(pool *p, server_rec *server, BUFF *inout, int child_num, int thread_num); CORE_EXPORT(void) ap_process_connection(conn_rec *); + /* Hooks */ +DECLARE_HOOK(void,pre_connection,(conn_rec *)) + #ifdef __cplusplus } #endif diff --git a/server/connection.c b/server/connection.c index 557f3188115..fbfda3402cc 100644 --- a/server/connection.c +++ b/server/connection.c @@ -64,6 +64,12 @@ #include "http_config.h" #include "http_vhost.h" +HOOK_STRUCT( + HOOK_LINK(pre_connection) +); + +IMPLEMENT_VOID_HOOK(pre_connection,(conn_rec *c),(c),1) + /* TODO: re-implement the lingering close stuff */ #define NO_LINGCLOSE @@ -188,7 +194,7 @@ CORE_EXPORT(void) ap_process_connection(conn_rec *c) ap_update_vhost_given_ip(c); - ap_run_pre_connection(c); + run_pre_connection(c); /* * Read and process each request found on our connection