From 7b1138e5ef13ad80104f14aa1d33cb9dcd514e1f Mon Sep 17 00:00:00 2001 From: Unbit Date: Mon, 26 May 2014 14:59:33 +0200 Subject: [PATCH] added perl low-level hook --- plugins/psgi/psgi_plugin.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/psgi/psgi_plugin.c b/plugins/psgi/psgi_plugin.c index ab50ed2f..a7c46026 100644 --- a/plugins/psgi/psgi_plugin.c +++ b/plugins/psgi/psgi_plugin.c @@ -992,7 +992,15 @@ static int uwsgi_perl_spooler(char *filename, char *buf, uint16_t len, char *bod return ret; } +static int uwsgi_perl_hook_perl(char *arg) { + SV *ret = perl_eval_pv(arg, 0); + if (!ret) return -1; + return 0; +} +static void uwsgi_perl_register_features() { + uwsgi_register_hook("perl", uwsgi_perl_hook_perl); +} struct uwsgi_plugin psgi_plugin = { @@ -1023,4 +1031,5 @@ struct uwsgi_plugin psgi_plugin = { .magic = uwsgi_perl_magic, .spooler = uwsgi_perl_spooler, + .on_load = uwsgi_perl_register_features, };