forked from pool/apache2
Petr Gajdos
02a733cd83
- modified patches % apache2-mod_proxy_uwsgi-fix-crash.patch (refreshed) - modified sources % apache2-loadmodule.conf % apache2-manual.conf % apache2-script-helpers % apache2@.service % sysconfig.apache2 - deleted patches - deprecated-scripts-arch.patch (not needed) - httpd-2.0.54-envvars.dif (not needed) - httpd-2.1.3alpha-layout.dif (renamed to apache2-system-dirs-layout.patch) - httpd-2.2.0-apxs-a2enmod.dif (not needed) - httpd-2.4.9-bnc690734.patch (renamed to apache2-LimitRequestFieldSize-limits-headers.patch) - httpd-2.4.x-fate317766-config-control-two-protocol-options.diff (renamed to apache2-HttpContentLengthHeadZero-HttpExpectStrict.patch) - httpd-2.x.x-logresolve.patch (renamed to apache2-logresolve-tmp-security.patch) - httpd-apachectl.patch (renamed to apache2-apachectl.patch) - httpd-implicit-pointer-decl.patch (not needed) - httpd-visibility.patch (not needed) - deleted sources - SUSE-NOTICE (outdated) - a2enflag (renamed to apache2-a2enflag) - a2enmod (renamed to apache2-a2enmod) - apache-22-24-upgrade (outdated) OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=624
49 lines
1.6 KiB
C
49 lines
1.6 KiB
C
/* Include the required headers from httpd */
|
|
#include "httpd.h"
|
|
#include "http_core.h"
|
|
#include "http_protocol.h"
|
|
#include "http_request.h"
|
|
|
|
/* Define prototypes of our functions in this module */
|
|
static void register_hooks(apr_pool_t *pool);
|
|
static int example_handler(request_rec *r);
|
|
|
|
/* Define our module as an entity and assign a function for registering hooks */
|
|
|
|
module AP_MODULE_DECLARE_DATA example_module =
|
|
{
|
|
STANDARD20_MODULE_STUFF,
|
|
NULL, // Per-directory configuration handler
|
|
NULL, // Merge handler for per-directory configurations
|
|
NULL, // Per-server configuration handler
|
|
NULL, // Merge handler for per-server configurations
|
|
NULL, // Any directives we may have for httpd
|
|
register_hooks // Our hook registering function
|
|
};
|
|
|
|
|
|
/* register_hooks: Adds a hook to the httpd process */
|
|
static void register_hooks(apr_pool_t *pool)
|
|
{
|
|
|
|
/* Hook the request handler */
|
|
ap_hook_handler(example_handler, NULL, NULL, APR_HOOK_LAST);
|
|
}
|
|
|
|
/* The handler function for our module.
|
|
* This is where all the fun happens!
|
|
*/
|
|
|
|
static int example_handler(request_rec *r)
|
|
{
|
|
/* First off, we need to check if this is a call for the "example" handler.
|
|
* If it is, we accept it and do our things, it not, we simply return DECLINED,
|
|
* and Apache will try somewhere else.
|
|
*/
|
|
if (!r->handler || strcmp(r->handler, "example-handler")) return (DECLINED);
|
|
|
|
// The first thing we will do is write a simple "Hello, world!" back to the client.
|
|
ap_rputs("Hello, world!<br/>\n", r);
|
|
return OK;
|
|
}
|