Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
This is mod_perl version 2.0
This is joesuf4's fork of mod_perl version 2.0. You can use it with
ithreads and mpm_event | mod_http2, provided you:

1. Clone the interepeters (Parent will core):
2. Avoid PerlSetupEnv (will core):
3. Avoid reaping ithreads until graceful httpd restarts (may core):
4. run with the joesuf4/apreq fork.

Rest is the dead software product from Apache...



*** Prerequisites ***

Expand Down
11 changes: 5 additions & 6 deletions src/modules/perl/mod_perl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,27 +1034,27 @@ int modperl_response_handler(request_rec *r)
{
MP_dDCFG;
apr_status_t retval, rc;
MP_dINTERP;

if (!strEQ(r->handler, "modperl")) {
return DECLINED;
}

MP_INTERPa(r, r->connection, r->server);

/* default is -SetupEnv, add if PerlOption +SetupEnv */

MP_dINTERPa(r, NULL, NULL);

if (MpDirSETUP_ENV(dcfg)) {
modperl_env_request_populate(aTHX_ r);
}


retval = modperl_response_handler_run(r);
rc = modperl_response_finish(r);
if (rc != APR_SUCCESS) {
retval = rc;
}

MP_INTERP_PUTBACK(interp, aTHX);

return retval;
}

Expand All @@ -1064,13 +1064,12 @@ int modperl_response_handler_cgi(request_rec *r)
GV *h_stdin, *h_stdout;
apr_status_t retval, rc;
MP_dRCFG;
MP_dINTERP;

if (!strEQ(r->handler, "perl-script")) {
return DECLINED;
}

MP_INTERPa(r, r->connection, r->server);
MP_dINTERPa(r, NULL, NULL);

modperl_perl_global_request_save(aTHX_ r);

Expand Down
4 changes: 2 additions & 2 deletions src/modules/perl/modperl_callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ int modperl_callback(pTHX_ modperl_handler_t *handler, apr_pool_t *p,
I32 flags = G_EVAL|G_SCALAR;
dSP;
int count, status = OK;
PERL_SET_CONTEXT(aTHX);

/* handler callbacks shouldn't affect each other's taintedness
* state, so start every callback with a clear tainted status
Expand Down Expand Up @@ -147,7 +148,6 @@ int modperl_callback_run_handlers(int idx, int type,
apr_pool_t *ptemp,
modperl_hook_run_mode_e run_mode)
{
MP_dINTERP;
MP_dSCFG(s);
MP_dDCFG;
MP_dRCFG;
Expand Down Expand Up @@ -180,7 +180,7 @@ int modperl_callback_run_handlers(int idx, int type,
return DECLINED;
}

MP_INTERPa(r, c, s);
MP_dINTERPa(r, c, s);

switch (type) {
case MP_HANDLER_TYPE_PER_SRV:
Expand Down
14 changes: 6 additions & 8 deletions src/modules/perl/modperl_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,12 @@ apr_status_t modperl_config_request_cleanup(pTHX_ request_rec *r)
apr_status_t modperl_config_req_cleanup(void *data)
{
request_rec *r = (request_rec *)data;
apr_status_t rc;
MP_dINTERPa(r, NULL, NULL);

rc = modperl_config_request_cleanup(aTHX_ r);

MP_INTERP_PUTBACK(interp, aTHX);

return rc;
apr_pool_t *p = r->main ? r->main->pool : r->pool;
modperl_interp_t *interp = modperl_interp_pool_get(p);
if (interp && interp->perl)
return modperl_config_request_cleanup(interp->perl, r);
dTHX;
return modperl_config_request_cleanup(aTHX_ r);
}

void *modperl_get_perl_module_config(ap_conf_vector_t *cv)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/perl/modperl_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static apr_status_t modperl_filter_f_cleanup(void *data)
if (ctx->data){
#ifdef USE_ITHREADS
dTHXa(ctx->interp->perl);
// MP_ASSERT_CONTEXT(aTHX);
MP_ASSERT_CONTEXT(aTHX);
#endif
if (SvOK(ctx->data) && SvREFCNT(ctx->data)) {
SvREFCNT_dec(ctx->data);
Expand Down
4 changes: 2 additions & 2 deletions src/modules/perl/modperl_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ void modperl_handler_make_args(pTHX_ AV **avp, ...)
*/
#define check_modify(dtype) \
if ((action > MP_HANDLER_ACTION_GET) && rcfg) { \
dTHXa(PERL_GET_CONTEXT); \
MP_ASSERT(aTHX+0); \
dTHX; \
MP_ASSERT(aTHX+0); \
Perl_croak(aTHX_ "too late to modify %s handlers", \
modperl_handler_desc_##dtype(idx)); \
}
Expand Down
Loading