OSDN Git Service

Fix pfilter module. pfilter-fix
authorKohei TANUMA <tanuma@users.sourceforge.jp>
Mon, 7 Jun 2010 16:42:51 +0000 (01:42 +0900)
committerKohei TANUMA <tanuma@users.sourceforge.jp>
Mon, 7 Jun 2010 16:42:51 +0000 (01:42 +0900)
module/protocol/protomod_pfilter.c
src/conn.c

index 0490f5f..c285193 100644 (file)
@@ -93,7 +93,7 @@ static struct l7vs_protomod pfilter_protomod = {
        NULL,           /* handle */
        "pfilter",          /* modname */
        0,              /* refcnt */
-       0,              /* fast schedule */
+       1,              /* fast schedule */
        create,         /* create function */
        compare,        /* compare function */
        select_dest,    /* select_dest function */
@@ -455,7 +455,6 @@ select_dest(struct l7vs_service *srv, struct l7vs_conn *conn,
        struct l7vs_pfilter_service *pfilter_service;
        int ret;
        int return_value = 0;
-    std::string packet_data;
 
        /*-------- DEBUG LOG --------*/
        if (pfilter_protomod.get_log_level != NULL &&
@@ -663,7 +662,9 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn,
 #else
        if ( boost::regex_search(packet_data, pfilter_service->regex) ) {
 #endif
-               return_value = -1;
+               PUT_LOG_INFO(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL, 20,
+                   "Connection reset by packet filter module");
+               conn->ciom->status = iomux_conn_disconnected;
                goto analyze_cldata_out;
        }
 
index fa184f2..ec94e28 100644 (file)
@@ -931,6 +931,12 @@ l7vs_conn_client_receiving(struct l7vs_iomux *iom)
             }
             l7vs_conn_QoS_recvsize_register( conn, conn->cldata_len, QOS_UP );
             break;
+        case iomux_conn_disconnected:
+            /* Some protocol modules(*) analyzed client request packets,
+             * then set iomux_conn_disconnected for destroying this connection.
+             * (*) ex. protomod_pfilter module
+             */
+            break;
         default:
             //invalid status
             LOGGER_PUT_LOG_ERROR(LOG_CAT_L7VSD_PROGRAM,34, "error / invalid status(%d)", iom->status);