From: Martin Kraemer
Such handlers can construct a sub-request, using the
- functions
Otherwise, they should produce a request body which responds to the
-client as appropriate. The primitives for this are
At this point, you should more or less understand the following piece
@@ -530,7 +530,7 @@ It should be noted that use of the pool machinery isn't generally
obligatory, except for situations like logging handlers, where you
really need to register cleanups to make sure that the log file gets
closed when the server restarts (this is most easily done by using the
-function
For the MIME module, the per-dir config creation function just
-
Such handlers can construct a sub-request, using the
- functions
Otherwise, they should produce a request body which responds to the
-client as appropriate. The primitives for this are
At this point, you should more or less understand the following piece
@@ -530,7 +530,7 @@ It should be noted that use of the pool machinery isn't generally
obligatory, except for situations like logging handlers, where you
really need to register cleanups to make sure that the log file gets
closed when the server restarts (this is most easily done by using the
-function
For the MIME module, the per-dir config creation function just
-sub_req_lookup_file
and
- sub_req_lookup_uri
; this constructs a new
+ functions ap_sub_req_lookup_file
and
+ ap_sub_req_lookup_uri
; this constructs a new
request_rec
structure and processes it as you
would expect, up to but not including the point of actually
sending a response. (These functions skip over the access
@@ -405,9 +405,9 @@ do; they should return after that, without attempting any further
output. rputc
-and rprintf
, for internally generated output, and
-send_fd
, to copy the contents of some FILE *
+client as appropriate. The primitives for this are ap_rputc
+and ap_rprintf
, for internally generated output, and
+ap_send_fd
, to copy the contents of some FILE *
straight to the client. pfopen
, which also
+function ap_pfopen
, which also
arranges for the underlying file descriptor to be closed before any
child processes, such as for CGI scripts, are exec
ed), or
in case you are using the timeout machinery (which isn't yet even
@@ -772,17 +772,17 @@ to vanish when the pool is cleared, by registering a cleanup on the
pool if necessary). palloc
s the structure above, and a creates a couple of
+ap_palloc
s the structure above, and a creates a couple of
table
s to fill it. That looks like this:
void *create_mime_dir_config (pool *p, char *dummy)
{
mime_dir_config *new =
- (mime_dir_config *) palloc (p, sizeof(mime_dir_config));
+ (mime_dir_config *) ap_palloc (p, sizeof(mime_dir_config));
- new->forced_types = make_table (p, 4);
- new->encoding_types = make_table (p, 4);
+ new->forced_types = ap_make_table (p, 4);
+ new->encoding_types = ap_make_table (p, 4);
return new;
}
@@ -846,7 +846,7 @@ the same, and won't be shown here):
char *add_type(cmd_parms *cmd, mime_dir_config *m, char *ct, char *ext)
{
if (*ext == '.') ++ext;
- table_set (m->forced_types, ext, ct);
+ ap_table_set (m->forced_types, ext, ct);
return NULL;
}
@@ -927,15 +927,15 @@ ultimately done in the module's handlers, specifically for its
file-typing handler, which looks more or less like this; note that the
per-directory configuration structure is extracted from the
request_rec
's per-directory configuration vector by using
-the get_module_config
function.
+the ap_get_module_config
function.
int find_ct(request_rec *r)
{
int i;
- char *fn = pstrdup (r->pool, r->filename);
+ char *fn = ap_pstrdup (r->pool, r->filename);
mime_dir_config *conf = (mime_dir_config *)
- get_module_config(r->per_dir_config, &mime_module);
+ ap_get_module_config(r->per_dir_config, &mime_module);
char *type;
if (S_ISDIR(r->finfo.st_mode)) {
@@ -943,21 +943,21 @@ int find_ct(request_rec *r)
return OK;
}
- if((i=rind(fn,'.')) < 0) return DECLINED;
+ if((i=ap_rind(fn,'.')) < 0) return DECLINED;
++i;
- if ((type = table_get (conf->encoding_types, &fn[i])))
+ if ((type = ap_table_get (conf->encoding_types, &fn[i])))
{
r->content_encoding = type;
/* go back to previous extension to try to use it as a type */
fn[i-1] = '\0';
- if((i=rind(fn,'.')) < 0) return OK;
+ if((i=ap_rind(fn,'.')) < 0) return OK;
++i;
}
- if ((type = table_get (conf->forced_types, &fn[i])))
+ if ((type = ap_table_get (conf->forced_types, &fn[i])))
{
r->content_type = type;
}
@@ -991,10 +991,10 @@ char *add_redirect(cmd_parms *cmd, void *dummy, char *f, char *url)
{
server_rec *s = cmd->server;
alias_server_conf *conf = (alias_server_conf *)
- get_module_config(s->module_config,&alias_module);
- alias_entry *new = push_array (conf->redirects);
+ ap_get_module_config(s->module_config,&alias_module);
+ alias_entry *new = ap_push_array (conf->redirects);
- if (!is_url (url)) return "Redirect to non-URL";
+ if (!ap_is_url (url)) return "Redirect to non-URL";
new->fake = f; new->real = url;
return NULL;
diff --git a/docs/manual/misc/API.html b/docs/manual/misc/API.html
index 4b47d48791..12a6dffc2e 100644
--- a/docs/manual/misc/API.html
+++ b/docs/manual/misc/API.html
@@ -357,8 +357,8 @@ a few exceptions:
order to figure out what icon to use.
sub_req_lookup_file
and
- sub_req_lookup_uri
; this constructs a new
+ functions ap_sub_req_lookup_file
and
+ ap_sub_req_lookup_uri
; this constructs a new
request_rec
structure and processes it as you
would expect, up to but not including the point of actually
sending a response. (These functions skip over the access
@@ -405,9 +405,9 @@ do; they should return after that, without attempting any further
output. rputc
-and rprintf
, for internally generated output, and
-send_fd
, to copy the contents of some FILE *
+client as appropriate. The primitives for this are ap_rputc
+and ap_rprintf
, for internally generated output, and
+ap_send_fd
, to copy the contents of some FILE *
straight to the client. pfopen
, which also
+function ap_pfopen
, which also
arranges for the underlying file descriptor to be closed before any
child processes, such as for CGI scripts, are exec
ed), or
in case you are using the timeout machinery (which isn't yet even
@@ -772,17 +772,17 @@ to vanish when the pool is cleared, by registering a cleanup on the
pool if necessary). palloc
s the structure above, and a creates a couple of
+ap_palloc
s the structure above, and a creates a couple of
table
s to fill it. That looks like this:
void *create_mime_dir_config (pool *p, char *dummy)
{
mime_dir_config *new =
- (mime_dir_config *) palloc (p, sizeof(mime_dir_config));
+ (mime_dir_config *) ap_palloc (p, sizeof(mime_dir_config));
- new->forced_types = make_table (p, 4);
- new->encoding_types = make_table (p, 4);
+ new->forced_types = ap_make_table (p, 4);
+ new->encoding_types = ap_make_table (p, 4);
return new;
}
@@ -846,7 +846,7 @@ the same, and won't be shown here):
char *add_type(cmd_parms *cmd, mime_dir_config *m, char *ct, char *ext)
{
if (*ext == '.') ++ext;
- table_set (m->forced_types, ext, ct);
+ ap_table_set (m->forced_types, ext, ct);
return NULL;
}
@@ -927,15 +927,15 @@ ultimately done in the module's handlers, specifically for its
file-typing handler, which looks more or less like this; note that the
per-directory configuration structure is extracted from the
request_rec
's per-directory configuration vector by using
-the get_module_config
function.
+the ap_get_module_config
function.
int find_ct(request_rec *r)
{
int i;
- char *fn = pstrdup (r->pool, r->filename);
+ char *fn = ap_pstrdup (r->pool, r->filename);
mime_dir_config *conf = (mime_dir_config *)
- get_module_config(r->per_dir_config, &mime_module);
+ ap_get_module_config(r->per_dir_config, &mime_module);
char *type;
if (S_ISDIR(r->finfo.st_mode)) {
@@ -943,21 +943,21 @@ int find_ct(request_rec *r)
return OK;
}
- if((i=rind(fn,'.')) < 0) return DECLINED;
+ if((i=ap_rind(fn,'.')) < 0) return DECLINED;
++i;
- if ((type = table_get (conf->encoding_types, &fn[i])))
+ if ((type = ap_table_get (conf->encoding_types, &fn[i])))
{
r->content_encoding = type;
/* go back to previous extension to try to use it as a type */
fn[i-1] = '\0';
- if((i=rind(fn,'.')) < 0) return OK;
+ if((i=ap_rind(fn,'.')) < 0) return OK;
++i;
}
- if ((type = table_get (conf->forced_types, &fn[i])))
+ if ((type = ap_table_get (conf->forced_types, &fn[i])))
{
r->content_type = type;
}
@@ -991,10 +991,10 @@ char *add_redirect(cmd_parms *cmd, void *dummy, char *f, char *url)
{
server_rec *s = cmd->server;
alias_server_conf *conf = (alias_server_conf *)
- get_module_config(s->module_config,&alias_module);
- alias_entry *new = push_array (conf->redirects);
+ ap_get_module_config(s->module_config,&alias_module);
+ alias_entry *new = ap_push_array (conf->redirects);
- if (!is_url (url)) return "Redirect to non-URL";
+ if (!ap_is_url (url)) return "Redirect to non-URL";
new->fake = f; new->real = url;
return NULL;
diff --git a/docs/manual/misc/client_block_api.html b/docs/manual/misc/client_block_api.html
index 8f89d1ad6e..c346c4adb3 100644
--- a/docs/manual/misc/client_block_api.html
+++ b/docs/manual/misc/client_block_api.html
@@ -33,13 +33,13 @@ accomplished while remaining backwards-compatible.
- int setup_client_block (request_rec *, int read_policy); - int should_client_block (request_rec *); - long get_client_block (request_rec *, char *buffer, int buffer_size); + int ap_setup_client_block (request_rec *, int read_policy); + int ap_should_client_block (request_rec *); + long ap_get_client_block (request_rec *, char *buffer, int buffer_size);
setup_client_block()
near the beginning of the request
+ap_setup_client_block()
near the beginning of the request
handler. This will set up all the necessary properties, and
will return either OK, or an error code. If the latter,
the module should return that error code. The second parameter
@@ -58,7 +58,7 @@ accomplished while remaining backwards-compatible.
should_client_block()
.
+ ap_should_client_block()
.
This will tell the module whether or not to read input. If it is 0,
the module should assume that the input is of a non-entity type
(e.g. a GET request). A nonzero response indicates that the module
@@ -68,7 +68,7 @@ accomplished while remaining backwards-compatible.
is *definitely* ready to read content. (otherwise, the point of the
100 response is defeated). Never call this function more than once.
-get_client_block
in a loop. Pass it a
+ap_get_client_block
in a loop. Pass it a
buffer and its
size. It will put data into the buffer (not necessarily the full
buffer, in the case of chunked inputs), and return the length of