Skip to content

Commit 40b6ad0

Browse files
author
Steve Hay
committed
Corrections to mistakes that I made in the course of merging everything from threading that wasn't already in httpd24 into this httpd24threading branch. I hope I have it correct now, but it wasn't an easy merge and there may still be mistakes. These all came to light in the course of building the new branch. More may come to light when I actually get it running.
git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/branches/httpd24threading@1538005 13f79535-47bb-0310-9956-ffa450edef68
1 parent 49b3b07 commit 40b6ad0

File tree

7 files changed

+128
-138
lines changed

7 files changed

+128
-138
lines changed

src/modules/perl/mod_perl.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ int modperl_init_vhost(server_rec *s, apr_pool_t *p,
394394
}
395395

396396
PERL_SET_CONTEXT(perl);
397-
MP_THX_INTERP_SET(perl, base_scfg->mip->parent);
397+
modperl_thx_interp_set(perl, base_scfg->mip->parent);
398398

399399
#endif /* USE_ITHREADS */
400400

@@ -470,7 +470,7 @@ void modperl_init(server_rec *base_server, apr_pool_t *p)
470470
/* after other parent perls were started in vhosts, make sure that
471471
* the context is set to the base_perl */
472472
PERL_SET_CONTEXT(base_perl);
473-
MP_THX_INTERP_SET(base_perl, base_scfg->mip->parent);
473+
modperl_thx_interp_set(base_perl, base_scfg->mip->parent);
474474
#endif
475475

476476
}

src/modules/perl/modperl_config.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ void modperl_set_perl_module_config(ap_conf_vector_t *cv, void *cfg);
6262

6363
#if defined(MP_IN_XS) && defined(WIN32)
6464
# define modperl_get_module_config(v) \
65-
modperl_get_perl_module_config(v)
65+
modperl_get_perl_module_config((v))
6666

67-
# define modperl_set_module_config((v), c) \
67+
# define modperl_set_module_config(v, c) \
6868
modperl_set_perl_module_config((v), (c))
6969
#else
7070
# define modperl_get_module_config(v) \
@@ -95,7 +95,7 @@ void modperl_set_perl_module_config(ap_conf_vector_t *cv, void *cfg);
9595

9696
#define modperl_config_con_get(c) \
9797
(c ? (modperl_config_con_t *) \
98-
modperl_get_module_config((C)->conn_config) : NULL)
98+
modperl_get_module_config((c)->conn_config) : NULL)
9999

100100
#define MP_dCCFG \
101101
modperl_config_con_t *ccfg = modperl_config_con_get(c)

src/modules/perl/modperl_env.c

-2
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ void modperl_env_request_tie(pTHX_ request_rec *r)
413413
#ifdef MP_PERL_HV_GMAGICAL_AWARE
414414
MP_TRACE_e(MP_FUNC, "[0x%lx] tie %%ENV, $r\t (%s%s)",
415415
modperl_interp_address(aTHX),
416-
modperl_pid_tid(r->pool), modperl_interp_address(aTHX),
417416
modperl_server_desc(r->server, r->pool), r->uri);
418417
SvGMAGICAL_on((SV*)ENVHV);
419418
#endif
@@ -426,7 +425,6 @@ void modperl_env_request_untie(pTHX_ request_rec *r)
426425
#ifdef MP_PERL_HV_GMAGICAL_AWARE
427426
MP_TRACE_e(MP_FUNC, "[0x%lx] untie %%ENV; # from r\t (%s%s)",
428427
modperl_interp_address(aTHX),
429-
modperl_pid_tid(r->pool), modperl_interp_address(aTHX),
430428
modperl_server_desc(r->server, r->pool), r->uri);
431429
SvGMAGICAL_off((SV*)ENVHV);
432430
#endif

src/modules/perl/modperl_interp.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ modperl_interp_t *modperl_interp_pool_select(apr_pool_t *p,
383383
/* set context (THX) for this thread */
384384
PERL_SET_CONTEXT(interp->perl);
385385
/* let the perl interpreter point back to its interp */
386-
MP_THX_INTERP_SET(interp->perl, interp);
386+
modperl_thx_interp_set(interp->perl, interp);
387387

388388
return interp;
389389
}
@@ -422,7 +422,7 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
422422
/* XXX: if no VirtualHosts w/ PerlOptions +Parent we can skip this */
423423
PERL_SET_CONTEXT(interp->perl);
424424
/* let the perl interpreter point back to its interp */
425-
MP_THX_INTERP_SET(interp->perl, interp);
425+
modperl_thx_interp_set(interp->perl, interp);
426426

427427
MP_TRACE_i(MP_FUNC,
428428
"using parent 0x%pp (perl=0x%pp) for %s:%d refcnt set to %d",
@@ -442,7 +442,7 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
442442
(unsigned long)ccfg->interp, ccfg->interp->refcnt);
443443
/* set context (THX) for this thread */
444444
PERL_SET_CONTEXT(ccfg->interp->perl);
445-
/* MP_THX_INTERP_SET is not called here because the interp
445+
/* modperl_thx_interp_set() is not called here because the interp
446446
* already belongs to the perl interpreter
447447
*/
448448
return ccfg->interp;
@@ -458,7 +458,7 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
458458
/* set context (THX) for this thread */
459459
PERL_SET_CONTEXT(interp->perl);
460460
/* let the perl interpreter point back to its interp */
461-
MP_THX_INTERP_SET(interp->perl, interp);
461+
modperl_thx_interp_set(interp->perl, interp);
462462

463463
/* make sure ccfg is initialized */
464464
modperl_config_con_init(c, ccfg);

src/modules/perl/modperl_module.c

+32-29
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,12 @@ static const char *modperl_module_cmd_take123(cmd_parms *parms,
356356
modperl_module_info_t *minfo = MP_MODULE_INFO(info->modp);
357357
modperl_module_cfg_t *srv_cfg;
358358
int modules_alias = 0;
359-
360-
MP_dINTERP_POOLa(p, s);
361-
362359
int count;
363-
PTR_TBL_t *table = modperl_module_config_table_get(aTHX_ TRUE);
360+
PTR_TBL_t *table;
364361
SV *obj = (SV *)NULL;
365-
dSP;
362+
MP_dINTERP_POOLa(p, s);
363+
364+
table = modperl_module_config_table_get(aTHX_ TRUE);
366365

367366
if (s->is_virtual) {
368367
MP_dSCFG(s);
@@ -438,32 +437,35 @@ static const char *modperl_module_cmd_take123(cmd_parms *parms,
438437
}
439438
}
440439

441-
ENTER;SAVETMPS;
442-
PUSHMARK(SP);
443-
EXTEND(SP, 2);
440+
{
441+
dSP;
442+
ENTER;SAVETMPS;
443+
PUSHMARK(SP);
444+
EXTEND(SP, 2);
444445

445-
PUSHs(obj);
446-
PUSHs(modperl_bless_cmd_parms(parms));
446+
PUSHs(obj);
447+
PUSHs(modperl_bless_cmd_parms(parms));
447448

448-
if (cmd->args_how != NO_ARGS) {
449-
PUSH_STR_ARG(one);
450-
PUSH_STR_ARG(two);
451-
PUSH_STR_ARG(three);
452-
}
449+
if (cmd->args_how != NO_ARGS) {
450+
PUSH_STR_ARG(one);
451+
PUSH_STR_ARG(two);
452+
PUSH_STR_ARG(three);
453+
}
453454

454-
PUTBACK;
455-
count = call_method(info->func_name, G_EVAL|G_SCALAR);
456-
SPAGAIN;
455+
PUTBACK;
456+
count = call_method(info->func_name, G_EVAL|G_SCALAR);
457+
SPAGAIN;
457458

458-
if (count == 1) {
459-
SV *sv = POPs;
460-
if (SvPOK(sv) && strEQ(SvPVX(sv), DECLINE_CMD)) {
461-
retval = DECLINE_CMD;
459+
if (count == 1) {
460+
SV *sv = POPs;
461+
if (SvPOK(sv) && strEQ(SvPVX(sv), DECLINE_CMD)) {
462+
retval = DECLINE_CMD;
463+
}
462464
}
463-
}
464465

465-
PUTBACK;
466-
FREETMPS;LEAVE;
466+
PUTBACK;
467+
FREETMPS;LEAVE;
468+
}
467469

468470
if (SvTRUE(ERRSV)) {
469471
retval = SvPVX(ERRSV);
@@ -777,11 +779,12 @@ const char *modperl_module_add(apr_pool_t *p, server_rec *s,
777779
const char *name, SV *mod_cmds)
778780
{
779781
MP_dSCFG(s);
780-
MP_dINTERPa(NULL, NULL, s);
781782
const char *errmsg;
782-
module *modp = (module *)apr_pcalloc(p, sizeof(*modp));
783-
modperl_module_info_t *minfo =
784-
(modperl_module_info_t *)apr_pcalloc(p, sizeof(*minfo));
783+
module *modp;
784+
modperl_module_info_t *minfo;
785+
MP_dINTERPa(NULL, NULL, s);
786+
modp = (module *)apr_pcalloc(p, sizeof(*modp));
787+
minfo = (modperl_module_info_t *)apr_pcalloc(p, sizeof(*minfo));
785788

786789
/* STANDARD20_MODULE_STUFF */
787790
modp->version = MODULE_MAGIC_NUMBER_MAJOR;

0 commit comments

Comments
 (0)