Overview
The module implements two commands,
RevealServerTag and RevealTag.
RevealServerTag names a server section and is
stored in the per-server configuration. RevealTag
names a directory (or location or file) section and is stored in the
per-directory configuration. When per-server or per-directory
configurations are merged, the resulting configuration is tagged with
a combination of the tags of the two merged sections. The module also
implements a handler, which generates HTML with interesting
information about a URL.
No self-respecting module starts without a copyright notice:
/* Reveal the order in which things are done. Copyright (C) 1996, 1998 Ben Laurie */
Note that the included http_protocol.h is only needed for the request handle; the other two are required by almost all modules:
#include "httpd.h" #include "http_config.h" #include "http_protocol.h" #include "http_request.h" [2.0] #include "apr_strings.h" [2.0] #include "http_connection.h" [2.0] #include "http_log.h" [2.0] #include "http_core.h" [2.0] #include "scoreboard.h" [2.0] #include <unistd.h> [2.0]
The per-directory configuration structure is:
typedef struct
{
char *szDir;
char *szTag;
} SPerDir;And the per-server configuration structure is:
typedef struct
{
char *szServer;
char *szTag;
} SPerServer;There is an unavoidable circular reference in most modules; the
module structure is needed to access the
per-server and per-directory configurations in the hook functions.
But in order to construct the module structure, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access