📄 mod_tpcc_template.c
字号:
/***************************
mod_tpcc_template.c
***************************
/*
** mod_tpcc.c -- Apache sample tpcc module
** [Autogenerated via ``apxs -n tpcc -g'']
**
** To play with this sample module, first compile it into a
** DSO file and install it into Apache's libexec directory
** by running:
**
** $ apxs -c -i mod_tpcc.c
**
** Then activate it in Apache's httpd.conf file, for instance
** for the URL /tpcc, as follows:
**
** # httpd.conf
** LoadModule tpcc_module libexec/mod_tpcc.so
** <Location /tpcc>
** SetHandler tpcc
** </Location>
**
** Then after restarting Apache via
**
** $ apachectl restart
**
** you immediately can request the URL /%NAME and watch for the
** output of this module. This can be achieved for instance via:
**
** $ lynx -mime_header http://localhost/tpcc
**
** The output should be similar to the following one:
**
** HTTP/1.1 200 OK
** Date: Tue, 31 Mar 1998 14:42:22 GMT
** Server: Apache/1.3.4 (Unix)
** Connection: close
** Content-Type: text/html
**
** The sample page from mod_tpcc.c
*/
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "ap_config.h"
/* The sample content handler */
static int tpcc_handler(request_rec *r)
{
r->content_type = "text/html";
ap_send_http_header(r);
if (!r->header_only)
ap_rputs("The sample page from mod_tpcc.c\n", r);
return OK;
}
/* Dispatch list of content handlers */
static const handler_rec tpcc_handlers[] = {{ "tpcc", tpcc_handler },{ NULL, NULL }};
/* Dispatch list for API hooks */
module MODULE_VAR_EXPORT tpcc_module = {STANDARD_MODULE_STUFF,
NULL, /* module initializer*/
NULL, /* create per-dir config structures*/
NULL, /* merge per-dir config structures*/
NULL, /* create per-server config structures*/
NULL, /* merge per-server config structures*/
NULL, /* table of config file commands*/
tpcc_handlers, /* [#8] MIME-typed-dispatched handlers */
NULL, /* [#1] URI to filename translation*/
NULL, /* [#4] validate user id from request*/
NULL, /* [#5] check if the user is ok _here_*/
NULL, /* [#3] check access by host address*/
NULL, /* [#6] determine MIME type*/
NULL, /* [#7] pre-run fixups*/
NULL, /* [#9] log a transaction*/
NULL, /* [#2] header parser*/
NULL, /* child_init*/
NULL, /* child_exit*/
NULL /* [#0] post read-request*/
#ifdef EAPI
,NULL, /* EAPI: add_module*/
NULL, /* EAPI: remove_module*/
NULL, /* EAPI: rewrite_command*/
NULL /* EAPI: new_connection*/
#endif
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -