From: Nishi Date: Mon, 23 Sep 2024 11:37:53 +0000 (+0000) Subject: adding new module return X-Git-Url: https://git.chaotic.ninja/gitweb/nishi/?a=commitdiff_plain;h=a537e22c9ea7388061cdf715d9f93b3a4c1281ef;p=tewi.git adding new module return git-svn-id: file:///raid/svn-personal/tewi/trunk@141 8739d7e6-ffea-ec47-b151-bdff447c6205 --- diff --git a/Server/server.c b/Server/server.c index 9dc3bc7..361a6e5 100644 --- a/Server/server.c +++ b/Server/server.c @@ -525,12 +525,16 @@ int32_t tw_server_pass(void* ptr) { if(mod_req != NULL) { int ret = mod_req(&tools, &req, &res); int co = ret & 0xff; - if(co == _TW_MODULE_PASS) continue; - if(co == _TW_MODULE_STOP) { + if(co == _TW_MODULE_PASS) { + continue; + } else if(co == _TW_MODULE_STOP) { + /* Handle response here ... */ res._processed = true; break; - } - if(co == _TW_MODULE_ERROR) { + } else if(co == _TW_MODULE_STOP2) { + res._processed = true; + break; + } else if(co == _TW_MODULE_ERROR) { tw_http_error(s, sock, (ret & 0xffff00) >> 8, name, port, vhost_entry); break; } diff --git a/Server/tw_module.h b/Server/tw_module.h index de82bf9..a747c25 100644 --- a/Server/tw_module.h +++ b/Server/tw_module.h @@ -18,6 +18,7 @@ struct tw_tool { enum TW_MODULE_RETURN { _TW_MODULE_PASS = 0, /* Pass to the next module. */ _TW_MODULE_STOP, /* Do not pass to the next module. */ + _TW_MODULE_STOP2, /* Do not pass to the next module, and do not handle response. */ _TW_MODULE_ERROR, /* Error, and do not pass to the next module. */ _TW_CONFIG_PARSED, /* Got parsed */ @@ -27,6 +28,7 @@ enum TW_MODULE_RETURN { #define TW_MODULE_PASS _TW_MODULE_PASS #define TW_MODULE_STOP _TW_MODULE_STOP +#define TW_MODULE_STOP2 _TW_MODULE_STOP2 #define TW_MODULE_ERROR(x) (_TW_MODULE_ERROR | ((x) << 8)) #define TW_CONFIG_PARSED _TW_CONFIG_PARSED diff --git a/Server/tw_version.h b/Server/tw_version.h index bc5a6e8..66d734a 100644 --- a/Server/tw_version.h +++ b/Server/tw_version.h @@ -7,7 +7,7 @@ extern "C" { #endif -#define TW_VERSION "1.05A\0" +#define TW_VERSION "1.06\0" const char* tw_get_version(void); const char* tw_get_platform(void);