]> Git repositories of Nishi - tewi.git/commitdiff
adding new module return
authorNishi <nishi@nishi.boats>
Mon, 23 Sep 2024 11:37:53 +0000 (11:37 +0000)
committerNishi <nishi@nishi.boats>
Mon, 23 Sep 2024 11:37:53 +0000 (11:37 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@141 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c
Server/tw_module.h
Server/tw_version.h

index 9dc3bc72b9979d9fde5926680e3cd08c06005083..361a6e527e35411fba77d67d199515867cc8935a 100644 (file)
@@ -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;
                                }
index de82bf98118616e5b7fc1085216792b2ebb408e3..a747c250cfbc939352793679a8921e4e50d08527 100644 (file)
@@ -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
index bc5a6e89b2dbb8b1300ad955e07c1b97c7626f42..66d734a6907e00c2f44d172a2e5e77c1a01cb4cc 100644 (file)
@@ -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);