Loading docs/manual/developer/API.html +21 −21 Changes for docs/manual/developer/API.html: 21 added lines, 21 removed lines. Original line number Diff line number Diff line Loading @@ -357,8 +357,8 @@ a few exceptions: order to figure out what icon to use.<P> Such handlers can construct a <EM>sub-request</EM>, using the functions <CODE>sub_req_lookup_file</CODE> and <CODE>sub_req_lookup_uri</CODE>; this constructs a new functions <CODE>ap_sub_req_lookup_file</CODE> and <CODE>ap_sub_req_lookup_uri</CODE>; this constructs a new <CODE>request_rec</CODE> 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 Loading Loading @@ -405,9 +405,9 @@ do; they should return after that, without attempting any further output. <P> Otherwise, they should produce a request body which responds to the client as appropriate. The primitives for this are <CODE>rputc</CODE> and <CODE>rprintf</CODE>, for internally generated output, and <CODE>send_fd</CODE>, to copy the contents of some <CODE>FILE *</CODE> client as appropriate. The primitives for this are <CODE>ap_rputc</CODE> and <CODE>ap_rprintf</CODE>, for internally generated output, and <CODE>ap_send_fd</CODE>, to copy the contents of some <CODE>FILE *</CODE> straight to the client. <P> At this point, you should more or less understand the following piece Loading Loading @@ -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 <CODE><A HREF="#pool-files">pfopen</A></CODE>, which also function <CODE><A HREF="#pool-files">ap_pfopen</A></CODE>, which also arranges for the underlying file descriptor to be closed before any child processes, such as for CGI scripts, are <CODE>exec</CODE>ed), or in case you are using the timeout machinery (which isn't yet even Loading Loading @@ -772,17 +772,17 @@ to vanish when the pool is cleared, by registering a cleanup on the pool if necessary). <P> For the MIME module, the per-dir config creation function just <CODE>palloc</CODE>s the structure above, and a creates a couple of <CODE>ap_palloc</CODE>s the structure above, and a creates a couple of <CODE>table</CODE>s to fill it. That looks like this: <PRE> 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; } Loading Loading @@ -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; } </PRE> Loading Loading @@ -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 <CODE>request_rec</CODE>'s per-directory configuration vector by using the <CODE>get_module_config</CODE> function. the <CODE>ap_get_module_config</CODE> function. <PRE> 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)) { Loading @@ -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; } Loading Loading @@ -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; Loading docs/manual/misc/API.html +21 −21 Changes for docs/manual/misc/API.html: 21 added lines, 21 removed lines. Original line number Diff line number Diff line Loading @@ -357,8 +357,8 @@ a few exceptions: order to figure out what icon to use.<P> Such handlers can construct a <EM>sub-request</EM>, using the functions <CODE>sub_req_lookup_file</CODE> and <CODE>sub_req_lookup_uri</CODE>; this constructs a new functions <CODE>ap_sub_req_lookup_file</CODE> and <CODE>ap_sub_req_lookup_uri</CODE>; this constructs a new <CODE>request_rec</CODE> 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 Loading Loading @@ -405,9 +405,9 @@ do; they should return after that, without attempting any further output. <P> Otherwise, they should produce a request body which responds to the client as appropriate. The primitives for this are <CODE>rputc</CODE> and <CODE>rprintf</CODE>, for internally generated output, and <CODE>send_fd</CODE>, to copy the contents of some <CODE>FILE *</CODE> client as appropriate. The primitives for this are <CODE>ap_rputc</CODE> and <CODE>ap_rprintf</CODE>, for internally generated output, and <CODE>ap_send_fd</CODE>, to copy the contents of some <CODE>FILE *</CODE> straight to the client. <P> At this point, you should more or less understand the following piece Loading Loading @@ -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 <CODE><A HREF="#pool-files">pfopen</A></CODE>, which also function <CODE><A HREF="#pool-files">ap_pfopen</A></CODE>, which also arranges for the underlying file descriptor to be closed before any child processes, such as for CGI scripts, are <CODE>exec</CODE>ed), or in case you are using the timeout machinery (which isn't yet even Loading Loading @@ -772,17 +772,17 @@ to vanish when the pool is cleared, by registering a cleanup on the pool if necessary). <P> For the MIME module, the per-dir config creation function just <CODE>palloc</CODE>s the structure above, and a creates a couple of <CODE>ap_palloc</CODE>s the structure above, and a creates a couple of <CODE>table</CODE>s to fill it. That looks like this: <PRE> 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; } Loading Loading @@ -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; } </PRE> Loading Loading @@ -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 <CODE>request_rec</CODE>'s per-directory configuration vector by using the <CODE>get_module_config</CODE> function. the <CODE>ap_get_module_config</CODE> function. <PRE> 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)) { Loading @@ -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; } Loading Loading @@ -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; Loading docs/manual/misc/client_block_api.html +6 −6 Changes for docs/manual/misc/client_block_api.html: 6 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -33,13 +33,13 @@ accomplished while remaining backwards-compatible.</P> <H3>The New API Functions</H3> <PRE> 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); </PRE> <OL> <LI>Call <CODE>setup_client_block()</CODE> near the beginning of the request <LI>Call <CODE>ap_setup_client_block()</CODE> 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 Loading @@ -58,7 +58,7 @@ accomplished while remaining backwards-compatible.</P> <LI>When you are ready to possibly accept input, call <CODE>should_client_block()</CODE>. <CODE>ap_should_client_block()</CODE>. 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 Loading @@ -68,7 +68,7 @@ accomplished while remaining backwards-compatible.</P> is <STRONG>*definitely*</STRONG> ready to read content. (otherwise, the point of the 100 response is defeated). Never call this function more than once. <LI>Finally, call <CODE>get_client_block</CODE> in a loop. Pass it a <LI>Finally, call <CODE>ap_get_client_block</CODE> 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 Loading Loading
docs/manual/developer/API.html +21 −21 Changes for docs/manual/developer/API.html: 21 added lines, 21 removed lines. Original line number Diff line number Diff line Loading @@ -357,8 +357,8 @@ a few exceptions: order to figure out what icon to use.<P> Such handlers can construct a <EM>sub-request</EM>, using the functions <CODE>sub_req_lookup_file</CODE> and <CODE>sub_req_lookup_uri</CODE>; this constructs a new functions <CODE>ap_sub_req_lookup_file</CODE> and <CODE>ap_sub_req_lookup_uri</CODE>; this constructs a new <CODE>request_rec</CODE> 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 Loading Loading @@ -405,9 +405,9 @@ do; they should return after that, without attempting any further output. <P> Otherwise, they should produce a request body which responds to the client as appropriate. The primitives for this are <CODE>rputc</CODE> and <CODE>rprintf</CODE>, for internally generated output, and <CODE>send_fd</CODE>, to copy the contents of some <CODE>FILE *</CODE> client as appropriate. The primitives for this are <CODE>ap_rputc</CODE> and <CODE>ap_rprintf</CODE>, for internally generated output, and <CODE>ap_send_fd</CODE>, to copy the contents of some <CODE>FILE *</CODE> straight to the client. <P> At this point, you should more or less understand the following piece Loading Loading @@ -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 <CODE><A HREF="#pool-files">pfopen</A></CODE>, which also function <CODE><A HREF="#pool-files">ap_pfopen</A></CODE>, which also arranges for the underlying file descriptor to be closed before any child processes, such as for CGI scripts, are <CODE>exec</CODE>ed), or in case you are using the timeout machinery (which isn't yet even Loading Loading @@ -772,17 +772,17 @@ to vanish when the pool is cleared, by registering a cleanup on the pool if necessary). <P> For the MIME module, the per-dir config creation function just <CODE>palloc</CODE>s the structure above, and a creates a couple of <CODE>ap_palloc</CODE>s the structure above, and a creates a couple of <CODE>table</CODE>s to fill it. That looks like this: <PRE> 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; } Loading Loading @@ -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; } </PRE> Loading Loading @@ -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 <CODE>request_rec</CODE>'s per-directory configuration vector by using the <CODE>get_module_config</CODE> function. the <CODE>ap_get_module_config</CODE> function. <PRE> 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)) { Loading @@ -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; } Loading Loading @@ -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; Loading
docs/manual/misc/API.html +21 −21 Changes for docs/manual/misc/API.html: 21 added lines, 21 removed lines. Original line number Diff line number Diff line Loading @@ -357,8 +357,8 @@ a few exceptions: order to figure out what icon to use.<P> Such handlers can construct a <EM>sub-request</EM>, using the functions <CODE>sub_req_lookup_file</CODE> and <CODE>sub_req_lookup_uri</CODE>; this constructs a new functions <CODE>ap_sub_req_lookup_file</CODE> and <CODE>ap_sub_req_lookup_uri</CODE>; this constructs a new <CODE>request_rec</CODE> 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 Loading Loading @@ -405,9 +405,9 @@ do; they should return after that, without attempting any further output. <P> Otherwise, they should produce a request body which responds to the client as appropriate. The primitives for this are <CODE>rputc</CODE> and <CODE>rprintf</CODE>, for internally generated output, and <CODE>send_fd</CODE>, to copy the contents of some <CODE>FILE *</CODE> client as appropriate. The primitives for this are <CODE>ap_rputc</CODE> and <CODE>ap_rprintf</CODE>, for internally generated output, and <CODE>ap_send_fd</CODE>, to copy the contents of some <CODE>FILE *</CODE> straight to the client. <P> At this point, you should more or less understand the following piece Loading Loading @@ -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 <CODE><A HREF="#pool-files">pfopen</A></CODE>, which also function <CODE><A HREF="#pool-files">ap_pfopen</A></CODE>, which also arranges for the underlying file descriptor to be closed before any child processes, such as for CGI scripts, are <CODE>exec</CODE>ed), or in case you are using the timeout machinery (which isn't yet even Loading Loading @@ -772,17 +772,17 @@ to vanish when the pool is cleared, by registering a cleanup on the pool if necessary). <P> For the MIME module, the per-dir config creation function just <CODE>palloc</CODE>s the structure above, and a creates a couple of <CODE>ap_palloc</CODE>s the structure above, and a creates a couple of <CODE>table</CODE>s to fill it. That looks like this: <PRE> 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; } Loading Loading @@ -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; } </PRE> Loading Loading @@ -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 <CODE>request_rec</CODE>'s per-directory configuration vector by using the <CODE>get_module_config</CODE> function. the <CODE>ap_get_module_config</CODE> function. <PRE> 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)) { Loading @@ -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; } Loading Loading @@ -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; Loading
docs/manual/misc/client_block_api.html +6 −6 Changes for docs/manual/misc/client_block_api.html: 6 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -33,13 +33,13 @@ accomplished while remaining backwards-compatible.</P> <H3>The New API Functions</H3> <PRE> 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); </PRE> <OL> <LI>Call <CODE>setup_client_block()</CODE> near the beginning of the request <LI>Call <CODE>ap_setup_client_block()</CODE> 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 Loading @@ -58,7 +58,7 @@ accomplished while remaining backwards-compatible.</P> <LI>When you are ready to possibly accept input, call <CODE>should_client_block()</CODE>. <CODE>ap_should_client_block()</CODE>. 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 Loading @@ -68,7 +68,7 @@ accomplished while remaining backwards-compatible.</P> is <STRONG>*definitely*</STRONG> ready to read content. (otherwise, the point of the 100 response is defeated). Never call this function more than once. <LI>Finally, call <CODE>get_client_block</CODE> in a loop. Pass it a <LI>Finally, call <CODE>ap_get_client_block</CODE> 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 Loading