diff --git a/core/utils.c b/core/utils.c index 9c29f6fb..0c2d40f1 100644 --- a/core/utils.c +++ b/core/utils.c @@ -1686,14 +1686,6 @@ int uwsgi_get_app_id(char *app_name, int app_name_len, int modifier1) { continue; } -#ifdef UWSGI_PCRE - if (uwsgi_apps[i].pattern) { - if (uwsgi_regexp_match(uwsgi_apps[i].pattern, uwsgi_apps[i].pattern_extra, app_name, app_name_len) >= 0) { - found = 1; - } - } - else -#endif if (!uwsgi_strncmp(uwsgi_apps[i].mountpoint, uwsgi_apps[i].mountpoint_len, app_name, app_name_len)) { found = 1; } diff --git a/core/uwsgi.c b/core/uwsgi.c index 42ec1a99..f0c5408c 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -385,9 +385,6 @@ static struct uwsgi_option uwsgi_base_options[] = { {"die-on-idle", no_argument, 0, "shutdown uWSGI when idle", uwsgi_opt_true, &uwsgi.die_on_idle, 0}, {"mount", required_argument, 0, "load application under mountpoint", uwsgi_opt_add_string_list, &uwsgi.mounts, 0}, {"worker-mount", required_argument, 0, "load application under mountpoint in the specified worker or after workers spawn", uwsgi_opt_add_string_list, &uwsgi.mounts, 0}, -#ifdef UWSGI_PCRE - {"regexp-mount", required_argument, 0, "load application under a regexp-based mountpoint", uwsgi_opt_add_string_list, &uwsgi.mounts, 0}, -#endif {"grunt", no_argument, 0, "enable grunt mode (in-request fork)", uwsgi_opt_true, &uwsgi.grunt, 0}, {"threads", required_argument, 0, "run each worker in prethreaded mode with the specified number of threads", uwsgi_opt_set_int, &uwsgi.threads, UWSGI_OPT_THREADS}, @@ -2981,20 +2978,8 @@ void uwsgi_init_all_apps() { what++; for (j = 0; j < 256; j++) { if (uwsgi.p[j]->mount_app) { -/* - if (!uwsgi_startswith(uwsgin[i], "regexp://", 9)) { - uwsgi_log("mounting %s on %s\n", what, uwsgi.mounts[i]+9); - if (uwsgi.p[j]->mount_app(uwsgi.mounts[i] + 9, what, 1) != -1) - break; - } - // skip worker-mount - else if (!uwsgi_startswith(uwsgi.mounts[i], "worker://", 9)) { - continue; - } - else { -*/ uwsgi_log("mounting %s on %s\n", what, app_mps->value); - if (uwsgi.p[j]->mount_app(app_mps->value, what, 0) != -1) + if (uwsgi.p[j]->mount_app(app_mps->value, what) != -1) break; } } diff --git a/plugins/psgi/psgi_loader.c b/plugins/psgi/psgi_loader.c index 70de36ed..7fec0f01 100644 --- a/plugins/psgi/psgi_loader.c +++ b/plugins/psgi/psgi_loader.c @@ -3,6 +3,7 @@ extern struct uwsgi_server uwsgi; struct uwsgi_perl uperl; +extern struct uwsgi_plugin psgi_plugin; XS(XS_input_seek) { @@ -442,10 +443,10 @@ int init_psgi_app(struct wsgi_request *wsgi_req, char *app, uint16_t app_len, Pe if (wsgi_req) { // we need a copy of app_id - wi = uwsgi_add_app(id, 5, uwsgi_concat2n(wsgi_req->appid, wsgi_req->appid_len, "", 0), wsgi_req->appid_len, interpreters, callables); + wi = uwsgi_add_app(id, psgi_plugin.modifier1, uwsgi_concat2n(wsgi_req->appid, wsgi_req->appid_len, "", 0), wsgi_req->appid_len, interpreters, callables); } else { - wi = uwsgi_add_app(id, 5, "", 0, interpreters, callables); + wi = uwsgi_add_app(id, psgi_plugin.modifier1, "", 0, interpreters, callables); } wi->started_at = now; diff --git a/plugins/psgi/psgi_plugin.c b/plugins/psgi/psgi_plugin.c index 0bd17f2b..fbc0d3a2 100644 --- a/plugins/psgi/psgi_plugin.c +++ b/plugins/psgi/psgi_plugin.c @@ -9,6 +9,8 @@ extern struct uwsgi_perl uperl; struct uwsgi_perl uperl; #endif +struct uwsgi_plugin psgi_plugin; + struct uwsgi_option uwsgi_perl_options[] = { {"psgi", required_argument, 0, "load a psgi app", uwsgi_opt_set_str, &uperl.psgi, 0}, @@ -390,7 +392,7 @@ int uwsgi_perl_request(struct wsgi_request *wsgi_req) { return -1; } - wsgi_req->app_id = uwsgi_get_app_id(wsgi_req->appid, wsgi_req->appid_len, 5); + wsgi_req->app_id = uwsgi_get_app_id(wsgi_req->appid, wsgi_req->appid_len, psgi_plugin.modifier1); // if it is -1, try to load a dynamic app if (wsgi_req->app_id == -1) { if (wsgi_req->dynamic) { @@ -514,7 +516,7 @@ void uwsgi_perl_post_fork() { } } -int uwsgi_perl_mount_app(char *mountpoint, char *app, int regexp) { +int uwsgi_perl_mount_app(char *mountpoint, char *app) { if (uwsgi_endswith(app, ".pl") || uwsgi_endswith(app, ".psgi")) { uwsgi.wsgi_req->appid = mountpoint; diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 929e48be..c2041425 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -865,7 +865,7 @@ int uwsgi_python_magic(char *mountpoint, char *lazy) { } -int uwsgi_python_mount_app(char *mountpoint, char *app, int regexp) { +int uwsgi_python_mount_app(char *mountpoint, char *app) { int id; @@ -878,21 +878,6 @@ int uwsgi_python_mount_app(char *mountpoint, char *app, int regexp) { else { id = init_uwsgi_app(LOADER_MOUNT, app, uwsgi.wsgi_req, NULL, PYTHON_APP_TYPE_WSGI); } - -#ifdef UWSGI_PCRE - int i; - if (regexp && id != -1) { - struct uwsgi_app *ua = &uwsgi_apps[id]; - uwsgi_regexp_build(mountpoint, &ua->pattern, &ua->pattern_extra); - if (uwsgi.mywid == 0) { - for(i=1;i<=uwsgi.numproc;i++) { - uwsgi.workers[i].apps[id].pattern = ua->pattern; - uwsgi.workers[i].apps[id].pattern_extra = ua->pattern_extra; - } - } - } -#endif - return id; } return -1; diff --git a/plugins/rack/rack_plugin.c b/plugins/rack/rack_plugin.c index 97f40897..2e532139 100644 --- a/plugins/rack/rack_plugin.c +++ b/plugins/rack/rack_plugin.c @@ -998,7 +998,7 @@ int uwsgi_rack_magic(char *mountpoint, char *lazy) { return 0; } -int uwsgi_rack_mount_app(char *mountpoint, char *app, int regexp) { +int uwsgi_rack_mount_app(char *mountpoint, char *app) { if (uwsgi_endswith(app, ".ru") || uwsgi_endswith(app, ".rb")) { diff --git a/uwsgi.h b/uwsgi.h index 308e2509..ac7f21a7 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -667,7 +667,7 @@ struct uwsgi_plugin { void (*fixup) (void); void (*master_fixup) (int); void (*master_cycle) (void); - int (*mount_app) (char *, char *, int); + int (*mount_app) (char *, char *); int (*manage_udp) (char *, int, char *, int); void (*suspend) (struct wsgi_request *); void (*resume) (struct wsgi_request *); @@ -714,11 +714,6 @@ struct uwsgi_app { char mountpoint[0xff]; int mountpoint_len; -#ifdef UWSGI_PCRE - pcre *pattern; - pcre_extra *pattern_extra; -#endif - void *interpreter; void *callable;