|
23 | 23 |
|
24 | 24 | #ifdef USE_ITHREADS
|
25 | 25 |
|
26 |
| -static const char *MP_interp_scope_desc[] = { |
27 |
| - "undef", "handler", "subrequest", "request", "connection", |
28 |
| -}; |
29 |
| - |
30 |
| -const char *modperl_interp_scope_desc(modperl_interp_scope_e scope) |
31 |
| -{ |
32 |
| - return MP_interp_scope_desc[scope]; |
33 |
| -} |
34 |
| - |
35 | 26 | void modperl_interp_clone_init(modperl_interp_t *interp)
|
36 | 27 | {
|
37 | 28 | dTHXa(interp->perl);
|
@@ -258,16 +249,6 @@ void modperl_interp_init(server_rec *s, apr_pool_t *p,
|
258 | 249 | scfg->mip = mip;
|
259 | 250 | }
|
260 | 251 |
|
261 |
| -#ifdef MP_TRACE |
262 |
| -static apr_status_t modperl_interp_pool_cleanup(void *data) |
263 |
| -{ |
264 |
| - MP_TRACE_i(MP_FUNC, "unselecting: (0x%lx)->refcnt=%ld", |
265 |
| - data, ((modperl_interp_t*)data)->refcnt); |
266 |
| - |
267 |
| - return modperl_interp_unselect(data); |
268 |
| -} |
269 |
| -#endif |
270 |
| - |
271 | 252 | apr_status_t modperl_interp_unselect(void *data)
|
272 | 253 | {
|
273 | 254 | modperl_interp_t *interp = (modperl_interp_t *)data;
|
@@ -413,7 +394,6 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
|
413 | 394 | const char *desc = NULL;
|
414 | 395 | modperl_interp_t *interp = NULL;
|
415 | 396 | apr_pool_t *p = NULL;
|
416 |
| - modperl_interp_scope_e scope; |
417 | 397 |
|
418 | 398 | /* What does the following condition mean?
|
419 | 399 | * (r || c): if true we are at runtime. There is some kind of request
|
@@ -476,63 +456,6 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
|
476 | 456 | "pulled interp %pp (perl=%pp) from mip, num_requests is %d",
|
477 | 457 | interp, interp->perl, interp->num_requests);
|
478 | 458 |
|
479 |
| - /* |
480 |
| - * if a per-dir PerlInterpScope is specified, use it. |
481 |
| - * else if r != NULL use per-server PerlInterpScope |
482 |
| - * else scope must be per-connection |
483 |
| - */ |
484 |
| - |
485 |
| - scope = (dcfg && !modperl_interp_scope_undef(dcfg)) ? |
486 |
| - dcfg->interp_scope : |
487 |
| - (r ? scfg->interp_scope : MP_INTERP_SCOPE_CONNECTION); |
488 |
| - |
489 |
| - MP_TRACE_i(MP_FUNC, "scope is per-%s", |
490 |
| - modperl_interp_scope_desc(scope)); |
491 |
| - |
492 |
| - if (scope != MP_INTERP_SCOPE_HANDLER) { |
493 |
| - desc = NULL; |
494 |
| - if (c && (scope == MP_INTERP_SCOPE_CONNECTION || !r)) { |
495 |
| - p = c->pool; |
496 |
| - desc = "connection"; |
497 |
| - } |
498 |
| - else if (r) { |
499 |
| - request_rec *main_r = r->main; |
500 |
| - |
501 |
| - if (main_r && (scope == MP_INTERP_SCOPE_REQUEST)) { |
502 |
| - /* share 1 interpreter across sub-requests */ |
503 |
| - for(; main_r; main_r = main_r->main) { |
504 |
| - p = main_r->pool; |
505 |
| - } |
506 |
| - desc = "main request"; |
507 |
| - } |
508 |
| - else { |
509 |
| - p = r->pool; |
510 |
| - desc = scope == MP_INTERP_SCOPE_REQUEST |
511 |
| - ? "main request" |
512 |
| - : "sub request"; |
513 |
| - } |
514 |
| - } |
515 |
| - |
516 |
| - MP_ASSERT(p); |
517 |
| - |
518 |
| -#ifdef MP_TRACE |
519 |
| - apr_pool_cleanup_register(p, (void *)interp, |
520 |
| - modperl_interp_pool_cleanup, |
521 |
| - modperl_interp_pool_cleanup); |
522 |
| -#else |
523 |
| - apr_pool_cleanup_register(p, (void *)interp, |
524 |
| - modperl_interp_unselect, |
525 |
| - modperl_interp_unselect); |
526 |
| -#endif |
527 |
| - |
528 |
| - /* add a reference for the registered cleanup */ |
529 |
| - interp->refcnt++; |
530 |
| - |
531 |
| - MP_TRACE_i(MP_FUNC, |
532 |
| - "registered unselect cleanup for interp 0x%lx in %s", |
533 |
| - (unsigned long)interp, desc); |
534 |
| - } |
535 |
| - |
536 | 459 | return interp;
|
537 | 460 | }
|
538 | 461 |
|
|
0 commit comments