浏览代码

mg_set_request_handler() mod to use pattern (Patch from Toni Wilk)

bel 11 年之前
父节点
当前提交
c23dc3e6ea
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/civetweb.c

+ 5 - 0
src/civetweb.c

@@ -5146,6 +5146,11 @@ static int use_request_handler(struct mg_connection *conn)
 
 
             return tmp_rh->handler(conn, tmp_rh->cbdata);
             return tmp_rh->handler(conn, tmp_rh->cbdata);
         }
         }
+
+        /* try for pattern match */
+        if (match_prefix(tmp_rh->uri, tmp_rh->uri_len, uri) > 0) {
+           return tmp_rh->handler(conn, tmp_rh->cbdata);
+        }
 
 
     }
     }