public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Correctly initialize Passenger on Apache 2.0.
Hongli Lai (Phusion) (author)
Thu Apr 24 06:20:24 -0700 2008
commit  bd59941af79a6d1c8d2ea6e42b61ffbf5ab57c3c
tree    df6cdacd09033c3cb36b908b69c3acdbd1c2b765
parent  636f14b64412beda938bac9091982731e9a6e947
...
566
567
568
569
 
 
 
570
571
 
 
 
 
 
 
 
 
572
573
574
...
663
664
665
 
...
566
567
568
 
569
570
571
572
 
573
574
575
576
577
578
579
580
581
582
583
...
672
673
674
675
0
@@ -566,9 +566,18 @@ init_module(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *
0
    * good hooks that we can use to avoid double initialization.
0
    *
0
    * So as a hack, we check whether Apache has already been daemonized, by checking
0
- * whether ppid() returns 1.
0
+ * whether ppid() returns 1. This doesn't work with Apache 2.0.x though: ppid()
0
+ * doesn't return 1. So Apache 2.0.x users will just have to live with the double
0
+ * initialization overhead.
0
    */
0
- if (getppid() == 1 || ap_exists_config_define("DEBUG")) {
0
+ bool passengerShouldBeInitialized;
0
+
0
+ #if (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER >= 2) || AP_SERVER_MAJORVERSION_NUMBER > 2
0
+ passengerShouldBeInitialized = getppid() == 1 || ap_exists_config_define("DEBUG");
0
+ #else
0
+ passengerShouldBeInitialized = true;
0
+ #endif
0
+ if (passengerShouldBeInitialized) {
0
     try {
0
       hooks = new Hooks(pconf, plog, ptemp, s);
0
       apr_pool_cleanup_register(pconf, NULL,
0
@@ -663,3 +672,4 @@ passenger_register_hooks(apr_pool_t *p) {
0
 /**
0
  * @}
0
  */
0
+

Comments

    No one has commented yet.