Skip to content

Commit cc2e4fa

Browse files
author
Steve Hay
committed
Merged revision(s) 671881 from perl/modperl/branches/threading:
expand tabs in C files ........ git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/branches/httpd24threading@1537758 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8704ded commit cc2e4fa

File tree

7 files changed

+110
-110
lines changed

7 files changed

+110
-110
lines changed

src/modules/perl/modperl_cmd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ MP_CMD_SRV_DECLARE(perldo)
586586
}
587587

588588
MP_TRACE_i(MP_FUNC, "using interp %lx to execute perl section:\n%s",
589-
scfg->mip->parent, arg);
589+
scfg->mip->parent, arg);
590590

591591
{
592592
SV *server = MP_PERLSECTIONS_SERVER_SV;

src/modules/perl/modperl_common_log.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ void modperl_trace(const char *func, const char *fmt, ...)
5151

5252
if (modperl_threaded_mpm()) {
5353
apr_file_printf(logfile, "[%lu/%lu] ", (unsigned long)getpid(),
54-
modperl_threads_started()
55-
? (unsigned long)apr_os_thread_current()
56-
: 0);
54+
modperl_threads_started()
55+
? (unsigned long)apr_os_thread_current()
56+
: 0);
5757
}
5858
else {
5959
apr_file_printf(logfile, "[%lu] ", (unsigned long)getpid());

src/modules/perl/modperl_config.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,15 @@ apr_status_t modperl_config_req_cleanup(void *data)
381381
modperl_interp_t *interp = modperl_interp_select(r, NULL, r->server);
382382

383383
MP_TRACE_i(MP_FUNC, "just selected: (0x%lx)->refcnt=%ld",
384-
interp, interp->refcnt);
384+
interp, interp->refcnt);
385385
aTHX = interp->perl;
386386
#endif
387387

388388
rc = modperl_config_request_cleanup(aTHX_ r);
389389

390390
#ifdef USE_ITHREADS
391391
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld",
392-
interp, interp->refcnt);
392+
interp, interp->refcnt);
393393
modperl_interp_unselect(interp);
394394
#endif
395395

src/modules/perl/modperl_interp.c

+86-86
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void modperl_interp_init(server_rec *s, apr_pool_t *p,
272272
static apr_status_t modperl_interp_pool_cleanup(void *data)
273273
{
274274
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld\n",
275-
data, ((modperl_interp_t*)data)->refcnt);
275+
data, ((modperl_interp_t*)data)->refcnt);
276276

277277
return modperl_interp_unselect(data);
278278
}
@@ -287,7 +287,7 @@ apr_status_t modperl_interp_unselect(void *data)
287287

288288
ap_assert(interp && MpInterpIN_USE(interp));
289289
MP_TRACE_i(MP_FUNC, "unselect(interp=0x%lx): refcnt=%d\n",
290-
(unsigned long)interp, interp->refcnt);
290+
(unsigned long)interp, interp->refcnt);
291291
if (interp->refcnt != 0) {
292292
--interp->refcnt;
293293
MP_TRACE_i(MP_FUNC, "interp=0x%lx, refcnt=%d -- interp still in use",
@@ -303,7 +303,7 @@ apr_status_t modperl_interp_unselect(void *data)
303303
modperl_tipool_putback_data(mip->tipool, data, interp->num_requests);
304304

305305
MP_TRACE_i(MP_FUNC, "interp=0x%lx freed, tipool(size=%ld, in_use=%ld)\n",
306-
(unsigned long)interp, mip->tipool->size, mip->tipool->in_use);
306+
(unsigned long)interp, mip->tipool->size, mip->tipool->in_use);
307307

308308
return APR_SUCCESS;
309309
}
@@ -349,64 +349,64 @@ modperl_interp_t *modperl_interp_pool_select(apr_pool_t *p,
349349
modperl_interp_t *interp = NULL;
350350

351351
if (is_startup) {
352-
if (scfg) {
353-
MP_TRACE_i(MP_FUNC, "using parent interpreter at startup");
354-
355-
if (!scfg->mip) {
356-
/* we get here if directive handlers are invoked
357-
* before server merge.
358-
*/
359-
modperl_init_vhost(s, p, NULL);
352+
if (scfg) {
353+
MP_TRACE_i(MP_FUNC, "using parent interpreter at startup");
354+
355+
if (!scfg->mip) {
356+
/* we get here if directive handlers are invoked
357+
* before server merge.
358+
*/
359+
modperl_init_vhost(s, p, NULL);
360360
if (!scfg->mip) {
361361
/* FIXME: We get here if global "server_rec" == s, scfg->mip
362362
* is not created then. I'm not sure if that's bug or
363363
* bad/good design decicision. For now just return NULL.
364364
*/
365365
return NULL;
366366
}
367-
}
367+
}
368368

369-
interp = scfg->mip->parent;
370-
}
371-
else {
372-
if (!(interp = modperl_interp_pool_get(p))) {
373-
interp = modperl_interp_get(s);
374-
modperl_interp_pool_set(p, interp);
375-
376-
MP_TRACE_i(MP_FUNC, "set interp 0x%lx in pconf pool 0x%lx",
377-
(unsigned long)interp, (unsigned long)p);
378-
}
379-
else {
380-
MP_TRACE_i(MP_FUNC, "found interp 0x%lx in pconf pool 0x%lx",
381-
(unsigned long)interp, (unsigned long)p);
382-
}
383-
}
369+
interp = scfg->mip->parent;
370+
}
371+
else {
372+
if (!(interp = modperl_interp_pool_get(p))) {
373+
interp = modperl_interp_get(s);
374+
modperl_interp_pool_set(p, interp);
384375

385-
/* set context (THX) for this thread */
386-
PERL_SET_CONTEXT(interp->perl);
387-
/* let the perl interpreter point back to its interp */
388-
MP_THX_INTERP_SET(interp->perl, interp);
376+
MP_TRACE_i(MP_FUNC, "set interp 0x%lx in pconf pool 0x%lx",
377+
(unsigned long)interp, (unsigned long)p);
378+
}
379+
else {
380+
MP_TRACE_i(MP_FUNC, "found interp 0x%lx in pconf pool 0x%lx",
381+
(unsigned long)interp, (unsigned long)p);
382+
}
383+
}
389384

390-
return interp;
385+
/* set context (THX) for this thread */
386+
PERL_SET_CONTEXT(interp->perl);
387+
/* let the perl interpreter point back to its interp */
388+
MP_THX_INTERP_SET(interp->perl, interp);
389+
390+
return interp;
391391
}
392392
else if (!modperl_threaded_mpm()) {
393-
MP_TRACE_i(MP_FUNC, "using parent interpreter in non-threaded mode");
393+
MP_TRACE_i(MP_FUNC, "using parent interpreter in non-threaded mode");
394394

395-
/* since we are not running in threaded mode PERL_SET_CONTEXT
396-
* is not necessary */
397-
/* PERL_SET_CONTEXT(scfg->mip->parent->perl); */
398-
/* let the perl interpreter point back to its interp */
399-
MP_THX_INTERP_SET(scfg->mip->parent->perl, scfg->mip->parent);
395+
/* since we are not running in threaded mode PERL_SET_CONTEXT
396+
* is not necessary */
397+
/* PERL_SET_CONTEXT(scfg->mip->parent->perl); */
398+
/* let the perl interpreter point back to its interp */
399+
MP_THX_INTERP_SET(scfg->mip->parent->perl, scfg->mip->parent);
400400

401-
return scfg->mip->parent;
401+
return scfg->mip->parent;
402402
}
403403
else {
404-
request_rec *r;
405-
apr_pool_userdata_get((void **)&r, "MODPERL_R", p);
406-
ap_assert(r);
407-
MP_TRACE_i(MP_FUNC, "found userdata MODPERL_R in pool %#lx as %lx",
408-
(unsigned long)r->pool, (unsigned long)r);
409-
return modperl_interp_select(r, NULL, s);
404+
request_rec *r;
405+
apr_pool_userdata_get((void **)&r, "MODPERL_R", p);
406+
ap_assert(r);
407+
MP_TRACE_i(MP_FUNC, "found userdata MODPERL_R in pool %#lx as %lx",
408+
(unsigned long)r->pool, (unsigned long)r);
409+
return modperl_interp_select(r, NULL, s);
410410
}
411411
}
412412

@@ -427,9 +427,9 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
427427
(unsigned long)scfg->mip->parent,
428428
s->server_hostname, s->port);
429429
/* XXX: if no VirtualHosts w/ PerlOptions +Parent we can skip this */
430-
PERL_SET_CONTEXT(scfg->mip->parent->perl);
431-
/* let the perl interpreter point back to its interp */
432-
MP_THX_INTERP_SET(scfg->mip->parent->perl, scfg->mip->parent);
430+
PERL_SET_CONTEXT(scfg->mip->parent->perl);
431+
/* let the perl interpreter point back to its interp */
432+
MP_THX_INTERP_SET(scfg->mip->parent->perl, scfg->mip->parent);
433433
return scfg->mip->parent;
434434
}
435435

@@ -442,11 +442,11 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
442442
MP_TRACE_i(MP_FUNC,
443443
"found interp 0x%lx in con config, refcnt incremented to %d\n",
444444
(unsigned long)ccfg->interp, ccfg->interp->refcnt);
445-
/* set context (THX) for this thread */
446-
PERL_SET_CONTEXT(ccfg->interp->perl);
447-
/* MP_THX_INTERP_SET is not called here because the interp
448-
* already belongs to the perl interpreter
449-
*/
445+
/* set context (THX) for this thread */
446+
PERL_SET_CONTEXT(ccfg->interp->perl);
447+
/* MP_THX_INTERP_SET is not called here because the interp
448+
* already belongs to the perl interpreter
449+
*/
450450
return ccfg->interp;
451451
}
452452

@@ -465,8 +465,8 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
465465
interp->ccfg = ccfg;
466466

467467
MP_TRACE_i(MP_FUNC,
468-
"pulled interp 0x%lx from mip, num_requests is %d\n",
469-
(unsigned long)interp, interp->num_requests);
468+
"pulled interp 0x%lx from mip, num_requests is %d\n",
469+
(unsigned long)interp, interp->num_requests);
470470

471471
/*
472472
* if a per-dir PerlInterpScope is specified, use it.
@@ -482,47 +482,47 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
482482
modperl_interp_scope_desc(scope));
483483

484484
if (scope != MP_INTERP_SCOPE_HANDLER) {
485-
desc = NULL;
485+
desc = NULL;
486486
if (c && (scope == MP_INTERP_SCOPE_CONNECTION || !r)) {
487-
p = c->pool;
488-
desc = "connection";
489-
}
490-
else if (r) {
491-
request_rec *main_r = r->main;
492-
493-
if (main_r && (scope == MP_INTERP_SCOPE_REQUEST)) {
494-
/* share 1 interpreter across sub-requests */
495-
for(; main_r; main_r = main_r->main) {
496-
p = main_r->pool;
497-
}
498-
desc = "main request";
499-
}
500-
else {
501-
p = r->pool;
502-
desc = scope == MP_INTERP_SCOPE_REQUEST
487+
p = c->pool;
488+
desc = "connection";
489+
}
490+
else if (r) {
491+
request_rec *main_r = r->main;
492+
493+
if (main_r && (scope == MP_INTERP_SCOPE_REQUEST)) {
494+
/* share 1 interpreter across sub-requests */
495+
for(; main_r; main_r = main_r->main) {
496+
p = main_r->pool;
497+
}
498+
desc = "main request";
499+
}
500+
else {
501+
p = r->pool;
502+
desc = scope == MP_INTERP_SCOPE_REQUEST
503503
? "main request"
504-
: "sub request";
505-
}
504+
: "sub request";
505+
}
506506
}
507507

508-
ap_assert(p);
508+
ap_assert(p);
509509

510510
#ifdef MP_TRACE
511-
apr_pool_cleanup_register(p, (void *)interp,
512-
modperl_interp_pool_cleanup,
513-
modperl_interp_pool_cleanup);
511+
apr_pool_cleanup_register(p, (void *)interp,
512+
modperl_interp_pool_cleanup,
513+
modperl_interp_pool_cleanup);
514514
#else
515-
apr_pool_cleanup_register(p, (void *)interp,
516-
modperl_interp_unselect,
517-
modperl_interp_unselect);
515+
apr_pool_cleanup_register(p, (void *)interp,
516+
modperl_interp_unselect,
517+
modperl_interp_unselect);
518518
#endif
519519

520-
/* add a reference for the registered cleanup */
521-
interp->refcnt++;
520+
/* add a reference for the registered cleanup */
521+
interp->refcnt++;
522522

523-
MP_TRACE_i(MP_FUNC,
524-
"registered unselect cleanup for interp 0x%lx in %s\n",
525-
(unsigned long)interp, desc);
523+
MP_TRACE_i(MP_FUNC,
524+
"registered unselect cleanup for interp 0x%lx in %s\n",
525+
(unsigned long)interp, desc);
526526
}
527527

528528
return interp;

src/modules/perl/modperl_module.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ static void *modperl_module_config_merge(apr_pool_t *p,
193193

194194
if (!base_obj || (base_obj == add_obj)) {
195195
#ifdef USE_ITHREADS
196-
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld\n",
197-
interp, interp->refcnt);
198-
modperl_interp_unselect(interp);
196+
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld\n",
197+
interp, interp->refcnt);
198+
modperl_interp_unselect(interp);
199199
MP_PERL_CONTEXT_RESTORE;
200200
#endif
201201
return addv;
@@ -248,7 +248,7 @@ static void *modperl_module_config_merge(apr_pool_t *p,
248248

249249
#ifdef USE_ITHREADS
250250
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld\n",
251-
interp, interp->refcnt);
251+
interp, interp->refcnt);
252252
modperl_interp_unselect(interp);
253253
MP_PERL_CONTEXT_RESTORE;
254254
#endif
@@ -419,9 +419,9 @@ static const char *modperl_module_cmd_take123(cmd_parms *parms,
419419

420420
if (errmsg) {
421421
#ifdef USE_ITHREADS
422-
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld\n",
423-
interp, interp->refcnt);
424-
modperl_interp_unselect(interp);
422+
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld\n",
423+
interp, interp->refcnt);
424+
modperl_interp_unselect(interp);
425425
#endif
426426
return errmsg;
427427
}
@@ -444,9 +444,9 @@ static const char *modperl_module_cmd_take123(cmd_parms *parms,
444444
parms, &srv_obj);
445445
if (errmsg) {
446446
#ifdef USE_ITHREADS
447-
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld\n",
448-
interp, interp->refcnt);
449-
modperl_interp_unselect(interp);
447+
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld\n",
448+
interp, interp->refcnt);
449+
modperl_interp_unselect(interp);
450450
#endif
451451
return errmsg;
452452
}
@@ -491,7 +491,7 @@ static const char *modperl_module_cmd_take123(cmd_parms *parms,
491491

492492
#ifdef USE_ITHREADS
493493
MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld\n",
494-
interp, interp->refcnt);
494+
interp, interp->refcnt);
495495
modperl_interp_unselect(interp);
496496
#endif
497497

@@ -874,7 +874,7 @@ const char *modperl_module_add(apr_pool_t *p, server_rec *s,
874874
if (!modperl_interp_pool_get(p)) {
875875
/* for vhosts */
876876
MP_TRACE_i(MP_FUNC, "set interp 0x%lx in pconf pool 0x%lx\n",
877-
(unsigned long)scfg->mip->parent, (unsigned long)p);
877+
(unsigned long)scfg->mip->parent, (unsigned long)p);
878878
modperl_interp_pool_set(p, scfg->mip->parent);
879879
}
880880
#endif

src/modules/perl/modperl_util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int modperl_restart_count(void);
137137
void modperl_pnotes_kill(void *data);
138138

139139
SV *modperl_pnotes(pTHX_ modperl_pnotes_t *pnotes, SV *key, SV *val,
140-
apr_pool_t *pool );
140+
apr_pool_t *pool );
141141

142142
U16 *modperl_code_attrs(pTHX_ CV *cv);
143143

xs/APR/Pool/APR__Pool.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ APR_OPTIONAL_FN_TYPE(modperl_thx_interp_get) *modperl_opt_thx_interp_get;
7777
* there are no more references, in which case \
7878
* the interpreter will be putback into the mip \
7979
*/ \
80-
MP_TRACE_i(MP_FUNC, "DO: calling interp_unselect(0x%lx)", \
81-
acct->interp); \
80+
MP_TRACE_i(MP_FUNC, "DO: calling interp_unselect(0x%lx)", \
81+
acct->interp); \
8282
(void)modperl_opt_interp_unselect(acct->interp); \
8383
} \
8484
} STMT_END
@@ -102,8 +102,8 @@ APR_OPTIONAL_FN_TYPE(modperl_thx_interp_get) *modperl_opt_thx_interp_get;
102102
if (modperl_opt_thx_interp_get) { \
103103
if ((acct->interp = modperl_opt_thx_interp_get(aTHX))) { \
104104
acct->interp->refcnt++; \
105-
MP_TRACE_i(MP_FUNC, "TO: (0x%lx)->refcnt incremented to %ld", \
106-
acct->interp, acct->interp->refcnt); \
105+
MP_TRACE_i(MP_FUNC, "TO: (0x%lx)->refcnt incremented to %ld", \
106+
acct->interp, acct->interp->refcnt); \
107107
} \
108108
} \
109109
} STMT_END
@@ -350,7 +350,7 @@ static MP_INLINE void mpxs_apr_pool_cleanup_register(pTHX_ apr_pool_t *p,
350350
if ((data->interp = modperl_opt_thx_interp_get(data->perl))) {
351351
data->interp->refcnt++;
352352
MP_TRACE_i(MP_FUNC, "(0x%lx)->refcnt incremented to %ld",
353-
data->interp, data->interp->refcnt);
353+
data->interp, data->interp->refcnt);
354354
}
355355
}
356356
#endif

0 commit comments

Comments
 (0)