Subversion Repositories Tewi

Rev

Rev 215 | Rev 315 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 215 Rev 313
Line 1... Line 1...
1
/* $Id: mod_cgi.c 215 2024-10-02 19:24:43Z nishi $ */
1
/* $Id: mod_cgi.c 313 2024-10-13 23:22:06Z nishi $ */
2
 
2
 
3
#include <tw_module.h>
3
#include <tw_module.h>
4
 
4
 
5
#include <cm_string.h>
5
#include <cm_string.h>
6
 
6
 
7
int mod_init(struct tw_config* config, struct tw_tool* tools) {
7
int MODULE_DECL mod_init(struct tw_config* config, struct tw_tool* tools) {
8
	tools->log("CGI", "Initializing CGI module");
8
	tools->log("CGI", "Initializing CGI module");
9
	tools->add_version("CGI/1.1");
9
	tools->add_version("CGI/1.1");
10
	return 0;
10
	return 0;
11
}
11
}
12
 
12
 
13
int mod_config(struct tw_tool* tools, char** argv, int argc) {
13
int MODULE_DECL mod_config(struct tw_tool* tools, char** argv, int argc) {
14
	if(cm_strcaseequ(argv[0], "AllowCGI")) {
14
	if(cm_strcaseequ(argv[0], "AllowCGI")) {
15
		return TW_CONFIG_PARSED;
15
		return TW_CONFIG_PARSED;
16
	}
16
	}
17
	return TW_CONFIG_NOTME;
17
	return TW_CONFIG_NOTME;
18
}
18
}
19
 
19
 
20
int mod_request(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res) {
20
int MODULE_DECL mod_request(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res) {
21
	res->status = 403;
21
	res->status = 403;
22
	return TW_MODULE_STOP;
22
	return TW_MODULE_STOP;
23
}
23
}