diff --git a/plugins/psgi/psgi.h b/plugins/psgi/psgi.h index 765534c1..f204b80a 100644 --- a/plugins/psgi/psgi.h +++ b/plugins/psgi/psgi.h @@ -70,6 +70,8 @@ struct uwsgi_perl { SV **early_psgi_callable; char *early_psgi_app_name; + + PerlInterpreter *early_interpreter; }; void init_perl_embedded_module(void); diff --git a/plugins/psgi/psgi_loader.c b/plugins/psgi/psgi_loader.c index 5d487b55..27b0280e 100644 --- a/plugins/psgi/psgi_loader.c +++ b/plugins/psgi/psgi_loader.c @@ -337,11 +337,13 @@ int init_psgi_app(struct wsgi_request *wsgi_req, char *app, uint16_t app_len, Pe if (!interpreters) goto clear2; callables = uwsgi_calloc(sizeof(SV *) * uwsgi.threads); - uperl.tmp_streaming_stash = uwsgi_calloc(sizeof(HV *) * uwsgi.threads); - uperl.tmp_input_stash = uwsgi_calloc(sizeof(HV *) * uwsgi.threads); - uperl.tmp_error_stash = uwsgi_calloc(sizeof(HV *) * uwsgi.threads); - uperl.tmp_stream_responder = uwsgi_calloc(sizeof(CV *) * uwsgi.threads); - uperl.tmp_psgix_logger = uwsgi_calloc(sizeof(CV *) * uwsgi.threads); + if (!uperl.early_interpreter) { + uperl.tmp_streaming_stash = uwsgi_calloc(sizeof(HV *) * uwsgi.threads); + uperl.tmp_input_stash = uwsgi_calloc(sizeof(HV *) * uwsgi.threads); + uperl.tmp_error_stash = uwsgi_calloc(sizeof(HV *) * uwsgi.threads); + uperl.tmp_stream_responder = uwsgi_calloc(sizeof(CV *) * uwsgi.threads); + uperl.tmp_psgix_logger = uwsgi_calloc(sizeof(CV *) * uwsgi.threads); + } for(i=0;i