passenger 3.0.9 → 3.0.10

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (67) hide show
  1. data/NEWS +32 -0
  2. data/Rakefile +1 -1
  3. data/build/common_library.rb +6 -1
  4. data/build/config.rb +3 -1
  5. data/doc/Users guide Apache.html +120 -39
  6. data/doc/Users guide Apache.txt +64 -0
  7. data/doc/Users guide Nginx.html +50 -2
  8. data/doc/Users guide Nginx.txt +29 -0
  9. data/ext/apache2/Bucket.cpp +7 -5
  10. data/ext/apache2/Bucket.h +2 -1
  11. data/ext/apache2/Configuration.cpp +8 -0
  12. data/ext/apache2/Configuration.hpp +9 -5
  13. data/ext/apache2/HelperAgent.cpp +4 -5
  14. data/ext/apache2/Hooks.cpp +1 -6
  15. data/ext/boost/thread/exceptions.hpp +7 -1
  16. data/ext/boost/thread/locks.hpp +11 -11
  17. data/ext/common/AgentBase.cpp +21 -1
  18. data/ext/common/AgentsStarter.hpp +22 -21
  19. data/ext/common/ApplicationPool/Client.h +0 -8
  20. data/ext/common/ApplicationPool/Server.h +22 -21
  21. data/ext/common/Constants.h +1 -1
  22. data/ext/common/EventedMessageServer.h +6 -2
  23. data/ext/common/IniFile.h +4 -4
  24. data/ext/common/Logging.h +1 -1
  25. data/ext/common/LoggingAgent/LoggingServer.h +2 -2
  26. data/ext/common/LoggingAgent/Main.cpp +2 -2
  27. data/ext/common/MessageChannel.h +20 -62
  28. data/ext/common/MessageReadersWriters.h +4 -4
  29. data/ext/common/MessageServer.h +18 -18
  30. data/ext/common/Process.h +4 -5
  31. data/ext/common/Session.h +6 -40
  32. data/ext/common/SpawnManager.h +20 -25
  33. data/ext/common/Utils.cpp +1 -1
  34. data/ext/common/Utils/Dechunker.h +1 -1
  35. data/ext/common/Utils/MessageIO.h +109 -14
  36. data/ext/common/Utils/StreamBoyerMooreHorspool.h +20 -14
  37. data/ext/common/Utils/VariantMap.h +9 -27
  38. data/ext/common/Watchdog.cpp +53 -42
  39. data/ext/libev/config.h +122 -0
  40. data/ext/nginx/Configuration.c +62 -0
  41. data/ext/nginx/Configuration.h +5 -0
  42. data/ext/nginx/ContentHandler.c +46 -19
  43. data/ext/nginx/HelperAgent.cpp +6 -5
  44. data/ext/nginx/config +12 -12
  45. data/ext/oxt/system_calls.cpp +10 -1
  46. data/ext/ruby/extconf.rb +0 -1
  47. data/ext/ruby/passenger_native_support.c +2 -2
  48. data/helper-scripts/prespawn +1 -1
  49. data/lib/phusion_passenger.rb +4 -4
  50. data/lib/phusion_passenger/classic_rails/application_spawner.rb +2 -2
  51. data/lib/phusion_passenger/dependencies.rb +6 -1
  52. data/lib/phusion_passenger/platform_info.rb +9 -0
  53. data/lib/phusion_passenger/platform_info/compiler.rb +5 -0
  54. data/lib/phusion_passenger/platform_info/operating_system.rb +1 -1
  55. data/lib/phusion_passenger/platform_info/ruby.rb +5 -5
  56. data/lib/phusion_passenger/rack/application_spawner.rb +6 -3
  57. data/lib/phusion_passenger/utils.rb +2 -2
  58. data/lib/phusion_passenger/wsgi/application_spawner.rb +1 -1
  59. data/resources/mime.types +2 -0
  60. data/test/cxx/LoggingTest.cpp +10 -12
  61. data/test/cxx/MessageIOTest.cpp +53 -3
  62. data/test/cxx/MessageReadersWritersTest.cpp +5 -2
  63. data/test/cxx/MessageServerTest.cpp +3 -1
  64. data/test/integration_tests/nginx_tests.rb +14 -1
  65. data/test/stub/rack/config.ru +2 -0
  66. data/test/tut/tut.h +9 -3
  67. metadata +5 -4
@@ -307,6 +307,7 @@ passenger_create_loc_conf(ngx_conf_t *cf)
307
307
  conf->base_uris = NGX_CONF_UNSET_PTR;
308
308
  conf->union_station_filters = NGX_CONF_UNSET_PTR;
309
309
  conf->min_instances = NGX_CONF_UNSET;
310
+ conf->max_requests = NGX_CONF_UNSET;
310
311
  conf->framework_spawner_idle_time = NGX_CONF_UNSET;
311
312
  conf->app_spawner_idle_time = NGX_CONF_UNSET;
312
313
 
@@ -361,6 +362,8 @@ passenger_create_loc_conf(ngx_conf_t *cf)
361
362
  DEFINE_VAR_TO_PASS("SERVER_ADDR", "$server_addr");
362
363
  DEFINE_VAR_TO_PASS("SERVER_PORT", "$server_port");
363
364
 
365
+ ngx_str_set(&conf->upstream_config.module, "passenger");
366
+
364
367
  return conf;
365
368
  }
366
369
 
@@ -398,6 +401,7 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
398
401
  ngx_conf_merge_str_value(conf->app_group_name, prev->app_group_name, NULL);
399
402
  ngx_conf_merge_str_value(conf->app_rights, prev->app_rights, NULL);
400
403
  ngx_conf_merge_value(conf->min_instances, prev->min_instances, (ngx_int_t) -1);
404
+ ngx_conf_merge_value(conf->max_requests, prev->max_requests, (ngx_int_t) -1);
401
405
  ngx_conf_merge_value(conf->framework_spawner_idle_time, prev->framework_spawner_idle_time, (ngx_int_t) -1);
402
406
  ngx_conf_merge_value(conf->app_spawner_idle_time, prev->app_spawner_idle_time, (ngx_int_t) -1);
403
407
 
@@ -584,6 +588,57 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
584
588
  prev->upstream_config.temp_path,
585
589
  &ngx_http_proxy_temp_path);
586
590
 
591
+ #if (NGX_HTTP_CACHE)
592
+
593
+ ngx_conf_merge_ptr_value(conf->upstream_config.cache,
594
+ prev->upstream_config.cache, NULL);
595
+
596
+ if (conf->upstream_config.cache && conf->upstream_config.cache->data == NULL) {
597
+ ngx_shm_zone_t *shm_zone;
598
+
599
+ shm_zone = conf->upstream_config.cache;
600
+
601
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
602
+ "\"scgi_cache\" zone \"%V\" is unknown",
603
+ &shm_zone->shm.name);
604
+
605
+ return NGX_CONF_ERROR;
606
+ }
607
+
608
+ ngx_conf_merge_uint_value(conf->upstream_config.cache_min_uses,
609
+ prev->upstream_config.cache_min_uses, 1);
610
+
611
+ ngx_conf_merge_bitmask_value(conf->upstream_config.cache_use_stale,
612
+ prev->upstream_config.cache_use_stale,
613
+ (NGX_CONF_BITMASK_SET
614
+ | NGX_HTTP_UPSTREAM_FT_OFF));
615
+
616
+ if (conf->upstream_config.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
617
+ conf->upstream_config.cache_use_stale = NGX_CONF_BITMASK_SET
618
+ | NGX_HTTP_UPSTREAM_FT_OFF;
619
+ }
620
+
621
+ if (conf->upstream_config.cache_methods == 0) {
622
+ conf->upstream_config.cache_methods = prev->upstream_config.cache_methods;
623
+ }
624
+
625
+ conf->upstream_config.cache_methods |= NGX_HTTP_GET | NGX_HTTP_HEAD;
626
+
627
+ ngx_conf_merge_ptr_value(conf->upstream_config.cache_bypass,
628
+ prev->upstream_config.cache_bypass, NULL);
629
+
630
+ ngx_conf_merge_ptr_value(conf->upstream_config.no_cache,
631
+ prev->upstream_config.no_cache, NULL);
632
+
633
+ ngx_conf_merge_ptr_value(conf->upstream_config.cache_valid,
634
+ prev->upstream_config.cache_valid, NULL);
635
+
636
+ if (conf->cache_key.value.data == NULL) {
637
+ conf->cache_key = prev->cache_key;
638
+ }
639
+
640
+ #endif
641
+
587
642
  ngx_conf_merge_value(conf->upstream_config.pass_request_headers,
588
643
  prev->upstream_config.pass_request_headers, 1);
589
644
  ngx_conf_merge_value(conf->upstream_config.pass_request_body,
@@ -1040,6 +1095,13 @@ const ngx_command_t passenger_commands[] = {
1040
1095
  offsetof(passenger_loc_conf_t, min_instances),
1041
1096
  NULL },
1042
1097
 
1098
+ { ngx_string("passenger_max_requests"),
1099
+ NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
1100
+ ngx_conf_set_num_slot,
1101
+ NGX_HTTP_LOC_CONF_OFFSET,
1102
+ offsetof(passenger_loc_conf_t, max_requests),
1103
+ NULL },
1104
+
1043
1105
  { ngx_string("passenger_max_instances_per_app"),
1044
1106
  NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
1045
1107
  ngx_conf_set_num_slot,
@@ -52,12 +52,17 @@ typedef struct {
52
52
  ngx_str_t app_group_name;
53
53
  ngx_str_t app_rights;
54
54
  ngx_int_t min_instances;
55
+ ngx_int_t max_requests;
55
56
  ngx_int_t framework_spawner_idle_time;
56
57
  ngx_int_t app_spawner_idle_time;
57
58
  ngx_str_t union_station_key;
58
59
  ngx_array_t *base_uris;
59
60
  ngx_array_t *union_station_filters;
60
61
 
62
+ #if (NGX_HTTP_CACHE)
63
+ ngx_http_complex_value_t cache_key;
64
+ #endif
65
+
61
66
  /************************************/
62
67
  } passenger_loc_conf_t;
63
68
 
@@ -223,11 +223,7 @@ find_base_uri(ngx_http_request_t *r, const passenger_loc_conf_t *loc,
223
223
  static void
224
224
  set_upstream_server_address(ngx_http_upstream_t *upstream, ngx_http_upstream_conf_t *upstream_config) {
225
225
  ngx_http_upstream_server_t *servers = upstream_config->upstream->servers->elts;
226
- #if NGINX_VERSION_NUM >= 8000
227
- ngx_addr_t *address = &servers[0].addrs[0];
228
- #else
229
- ngx_peer_addr_t *address = &servers[0].addrs[0];
230
- #endif
226
+ ngx_addr_t *address = &servers[0].addrs[0];
231
227
  const char *request_socket_filename;
232
228
  unsigned int request_socket_filename_len;
233
229
  struct sockaddr_un *sockaddr;
@@ -311,6 +307,31 @@ set_upstream_server_address(ngx_http_upstream_t *upstream, ngx_http_upstream_con
311
307
  } while (0)
312
308
 
313
309
 
310
+ #if (NGX_HTTP_CACHE)
311
+
312
+ static ngx_int_t
313
+ create_key(ngx_http_request_t *r)
314
+ {
315
+ ngx_str_t *key;
316
+ passenger_loc_conf_t *slcf;
317
+
318
+ key = ngx_array_push(&r->cache->keys);
319
+ if (key == NULL) {
320
+ return NGX_ERROR;
321
+ }
322
+
323
+ slcf = ngx_http_get_module_loc_conf(r, ngx_http_passenger_module);
324
+
325
+ if (ngx_http_complex_value(r, &slcf->cache_key, key) != NGX_OK) {
326
+ return NGX_ERROR;
327
+ }
328
+
329
+ return NGX_OK;
330
+ }
331
+
332
+ #endif
333
+
334
+
314
335
  static ngx_int_t
315
336
  create_request(ngx_http_request_t *r)
316
337
  {
@@ -325,6 +346,7 @@ create_request(ngx_http_request_t *r)
325
346
  ngx_str_t escaped_uri;
326
347
  ngx_str_t *union_station_filters = NULL;
327
348
  u_char min_instances_string[12];
349
+ u_char max_requests_string[12];
328
350
  u_char framework_spawner_idle_time_string[12];
329
351
  u_char app_spawner_idle_time_string[12];
330
352
  u_char *end;
@@ -338,7 +360,6 @@ create_request(ngx_http_request_t *r)
338
360
  ngx_http_script_engine_t e, le;
339
361
  ngx_http_core_srv_conf_t *cscf;
340
362
  passenger_loc_conf_t *slcf;
341
- passenger_main_conf_t *main_conf;
342
363
  passenger_context_t *context;
343
364
  ngx_http_script_len_code_pt lcode;
344
365
  #if (NGX_HTTP_SSL)
@@ -347,7 +368,6 @@ create_request(ngx_http_request_t *r)
347
368
 
348
369
  cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
349
370
  slcf = ngx_http_get_module_loc_conf(r, ngx_http_passenger_module);
350
- main_conf = &passenger_main_conf;
351
371
  context = ngx_http_get_module_ctx(r, ngx_http_passenger_module);
352
372
  if (context == NULL) {
353
373
  return NGX_HTTP_INTERNAL_SERVER_ERROR;
@@ -469,6 +489,14 @@ create_request(ngx_http_request_t *r)
469
489
  *end = '\0';
470
490
  len += sizeof("PASSENGER_MIN_INSTANCES") +
471
491
  ngx_strlen(min_instances_string) + 1;
492
+
493
+ end = ngx_snprintf(max_requests_string,
494
+ sizeof(max_requests_string) - 1,
495
+ "%d",
496
+ (slcf->max_requests == (ngx_int_t) -1) ? 0 : slcf->max_requests);
497
+ *end = '\0';
498
+ len += sizeof("PASSENGER_MAX_REQUESTS") +
499
+ ngx_strlen(max_requests_string) + 1;
472
500
 
473
501
  end = ngx_snprintf(framework_spawner_idle_time_string,
474
502
  sizeof(framework_spawner_idle_time_string) - 1,
@@ -725,6 +753,11 @@ create_request(ngx_http_request_t *r)
725
753
  b->last = ngx_copy(b->last, min_instances_string,
726
754
  ngx_strlen(min_instances_string) + 1);
727
755
 
756
+ b->last = ngx_copy(b->last, "PASSENGER_MAX_REQUESTS",
757
+ sizeof("PASSENGER_MAX_REQUESTS"));
758
+ b->last = ngx_copy(b->last, max_requests_string,
759
+ ngx_strlen(max_requests_string) + 1);
760
+
728
761
  b->last = ngx_copy(b->last, "PASSENGER_FRAMEWORK_SPAWNER_IDLE_TIME",
729
762
  sizeof("PASSENGER_FRAMEWORK_SPAWNER_IDLE_TIME"));
730
763
  b->last = ngx_copy(b->last, framework_spawner_idle_time_string,
@@ -1396,24 +1429,19 @@ passenger_content_handler(ngx_http_request_t *r)
1396
1429
 
1397
1430
  /* Setup upstream stuff and prepare sending the request to the backend. */
1398
1431
 
1399
- u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t));
1400
- if (u == NULL) {
1432
+ if (ngx_http_upstream_create(r) != NGX_OK) {
1401
1433
  return NGX_HTTP_INTERNAL_SERVER_ERROR;
1402
1434
  }
1435
+ u = r->upstream;
1403
1436
 
1404
1437
  u->schema = passenger_schema_string;
1405
-
1406
- u->peer.log = r->connection->log;
1407
- u->peer.log_error = NGX_ERROR_ERR;
1408
- #if (NGX_THREADS)
1409
- u->peer.lock = &r->connection->lock;
1410
- #endif
1411
-
1412
1438
  u->output.tag = (ngx_buf_tag_t) &ngx_http_passenger_module;
1413
-
1414
1439
  set_upstream_server_address(u, &slcf->upstream_config);
1415
1440
  u->conf = &slcf->upstream_config;
1416
1441
 
1442
+ #if (NGX_HTTP_CACHE)
1443
+ u->create_key = create_key;
1444
+ #endif
1417
1445
  u->create_request = create_request;
1418
1446
  u->reinit_request = reinit_request;
1419
1447
  u->process_header = process_status_line;
@@ -1428,8 +1456,7 @@ passenger_content_handler(ngx_http_request_t *r)
1428
1456
  }
1429
1457
 
1430
1458
  u->pipe->input_filter = ngx_event_pipe_copy_input_filter;
1431
-
1432
- r->upstream = u;
1459
+ u->pipe->input_ctx = r;
1433
1460
 
1434
1461
  rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init);
1435
1462
 
@@ -60,6 +60,8 @@
60
60
  #include "Exceptions.h"
61
61
  #include "Utils.h"
62
62
  #include "Utils/Timer.h"
63
+ #include <Utils/IOUtils.h>
64
+ #include <Utils/MessageIO.h>
63
65
  #include <Utils/Dechunker.h>
64
66
  #include <Utils/HttpHeaderBufferer.h>
65
67
  #include <Utils/StreamBoyerMooreHorspool.h>
@@ -452,10 +454,9 @@ private:
452
454
  */
453
455
  bool readAndCheckPassword(FileDescriptor &fd) {
454
456
  TRACE_POINT();
455
- MessageChannel channel(fd);
456
457
  char buf[REQUEST_SOCKET_PASSWORD_SIZE];
457
458
 
458
- if (channel.readRaw(buf, sizeof(buf))) {
459
+ if (readExact(fd, buf, sizeof(buf)) == sizeof(buf)) {
459
460
  const char *password_data;
460
461
 
461
462
  password_data = const_cast<const string &>(password).c_str();
@@ -818,6 +819,7 @@ private:
818
819
  parser.getHeader("PASSENGER_APP_RIGHTS"),
819
820
  DEFAULT_BACKEND_ACCOUNT_RIGHTS);
820
821
  options.minProcesses = atol(parser.getHeader("PASSENGER_MIN_INSTANCES"));
822
+ options.maxRequests = atol(parser.getHeader("PASSENGER_MAX_REQUESTS"));
821
823
  options.frameworkSpawnerTimeout = atol(parser.getHeader("PASSENGER_FRAMEWORK_SPAWNER_IDLE_TIME"));
822
824
  options.appSpawnerTimeout = atol(parser.getHeader("PASSENGER_APP_SPAWNER_IDLE_TIME"));
823
825
  options.debugger = parser.getHeader("PASSENGER_DEBUGGER") == "true";
@@ -1043,7 +1045,6 @@ private:
1043
1045
  unsigned int numberOfThreads;
1044
1046
  FileDescriptor requestSocket;
1045
1047
  string requestSocketPassword;
1046
- MessageChannel feedbackChannel;
1047
1048
  ServerInstanceDir serverInstanceDir;
1048
1049
  ServerInstanceDir::GenerationPtr generation;
1049
1050
  set<ClientPtr> clients;
@@ -1175,7 +1176,6 @@ public:
1175
1176
  this->userSwitching = userSwitching;
1176
1177
  this->defaultUser = defaultUser;
1177
1178
  this->defaultGroup = defaultGroup;
1178
- feedbackChannel = MessageChannel(feedbackFd);
1179
1179
  numberOfThreads = maxPoolSize * 4;
1180
1180
 
1181
1181
  sbmh_init(NULL, &statusFinder_occ,
@@ -1220,7 +1220,8 @@ public:
1220
1220
  messageServer->addHandler(ptr(new ExitHandler(exitEvent)));
1221
1221
 
1222
1222
  UPDATE_TRACE_POINT();
1223
- feedbackChannel.write("initialized",
1223
+ writeArrayMessage(feedbackFd,
1224
+ "initialized",
1224
1225
  getRequestSocketFilename().c_str(),
1225
1226
  messageServer->getSocketFilename().c_str(),
1226
1227
  NULL);
data/ext/nginx/config CHANGED
@@ -13,18 +13,6 @@ if ! test -f "$ngx_addon_dir/../common/libpassenger_common.a" || \
13
13
  echo "*** Phusion Passenger support files have been successfully compiled. ***"
14
14
  fi
15
15
 
16
- ngx_feature="Math library"
17
- ngx_feature_name=
18
- ngx_feature_run=no
19
- ngx_feature_incs="#include <math.h>"
20
- ngx_feature_path=
21
- ngx_feature_libs="-lm"
22
- ngx_feature_test="pow(1, 2)"
23
- . auto/feature
24
- if [ $ngx_found = yes ]; then
25
- CORE_LIBS="$CORE_LIBS -lm"
26
- fi
27
-
28
16
  ngx_addon_name=ngx_http_passenger_module
29
17
  HTTP_MODULES="$HTTP_MODULES ngx_http_passenger_module"
30
18
  NGX_ADDON_SRCS="$NGX_ADDON_SRCS \
@@ -43,6 +31,18 @@ CORE_LIBS="$CORE_LIBS \
43
31
  ${ngx_addon_dir}/../common/libboost_oxt.a \
44
32
  -lstdc++ -lpthread"
45
33
 
34
+ ngx_feature="Math library"
35
+ ngx_feature_name=
36
+ ngx_feature_run=no
37
+ ngx_feature_incs="#include <math.h>"
38
+ ngx_feature_path=
39
+ ngx_feature_libs="-lm"
40
+ ngx_feature_test="pow(1, 2)"
41
+ . auto/feature
42
+ if [ $ngx_found = yes ]; then
43
+ CORE_LIBS="$CORE_LIBS -lm"
44
+ fi
45
+
46
46
  nginx_version=`grep 'NGINX_VERSION ' src/core/nginx.h | awk '{ print $3 }' | sed 's/"//g'`
47
47
 
48
48
  nginx_major_version=`echo "$nginx_version" | cut -d . -f 1`
@@ -410,7 +410,16 @@ syscalls::nanosleep(const struct timespec *req, struct timespec *rem) {
410
410
  do {
411
411
  ret = ::nanosleep(&req2, &rem2);
412
412
  e = errno;
413
- req2 = rem2;
413
+ // nanosleep() on some systems is sometimes buggy. rem2
414
+ // could end up containing a tv_sec with a value near 2^32-1,
415
+ // probably because of integer wrapping bugs in the kernel.
416
+ // So we check for those.
417
+ if (rem2.tv_sec < req->tv_sec) {
418
+ req2 = rem2;
419
+ } else {
420
+ req2.tv_sec = 0;
421
+ req2.tv_nsec = 0;
422
+ }
414
423
  } while (ret == -1 && e == EINTR && !this_thread::syscalls_interruptable());
415
424
  if (ret == -1 && e == EINTR && this_thread::syscalls_interruptable()) {
416
425
  throw thread_interrupted();
data/ext/ruby/extconf.rb CHANGED
@@ -35,7 +35,6 @@ end
35
35
 
36
36
  have_header('alloca.h')
37
37
  have_header('ruby/io.h')
38
- have_func('rb_reserved_fd_p')
39
38
 
40
39
  with_cflags($CFLAGS) do
41
40
  create_makefile('passenger_native_support')
@@ -276,8 +276,8 @@ close_all_file_descriptors(VALUE self, VALUE exceptions) {
276
276
 
277
277
  for (i = sysconf(_SC_OPEN_MAX) - 1; i >= 0; i--) {
278
278
  int is_exception = 0;
279
- #ifdef HAVE_RB_RESERVED_FD_P
280
- is_exception = rb_reserved_fd_p(i);
279
+ #ifdef RB_RESERVED_FD_P
280
+ is_exception = rb_reserved_fd_p((int) i);
281
281
  #endif
282
282
  for (j = 0; j < RARRAY_LEN(exceptions) && !is_exception; j++) {
283
283
  long fd = NUM2INT(rb_ary_entry(exceptions, j));
@@ -102,7 +102,7 @@ class TCPPrespawnLocation < PrespawnLocation
102
102
  end
103
103
 
104
104
  def connect
105
- TCPSocket.new(request_host, request_port)
105
+ TCPSocket.new('127.0.0.1', request_port)
106
106
  end
107
107
  end
108
108
 
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - http://www.modrails.com/
2
- # Copyright (c) 2010 Phusion
2
+ # Copyright (c) 2010, 2011 Phusion
3
3
  #
4
4
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
5
  #
@@ -25,9 +25,9 @@ module PhusionPassenger
25
25
  ###### Version numbers ######
26
26
 
27
27
  # Phusion Passenger version number. Don't forget to edit ext/common/Constants.h too.
28
- VERSION_STRING = '3.0.9'
28
+ VERSION_STRING = '3.0.10'
29
29
 
30
- PREFERRED_NGINX_VERSION = '1.0.6'
30
+ PREFERRED_NGINX_VERSION = '1.0.10'
31
31
  PREFERRED_PCRE_VERSION = '8.12'
32
32
  STANDALONE_INTERFACE_VERSION = 1
33
33
 
@@ -108,7 +108,7 @@ module PhusionPassenger
108
108
  STANDALONE_BINARIES_URL_ROOT = "http://standalone-binaries.modrails.com"
109
109
 
110
110
 
111
- if $LOAD_PATH.first != LIBDIR
111
+ if !$LOAD_PATH.include?(LIBDIR)
112
112
  $LOAD_PATH.unshift(LIBDIR)
113
113
  $LOAD_PATH.uniq!
114
114
  end
@@ -172,7 +172,7 @@ protected
172
172
  # Overrided method.
173
173
  def initialize_server # :nodoc:
174
174
  report_app_init_status(MessageChannel.new(@owner_socket)) do
175
- $0 = "Passenger ApplicationSpawner: #{@app_root}"
175
+ $0 = "Passenger ApplicationSpawner: #{@options['app_group_name']}"
176
176
  prepare_app_process('config/environment.rb', @options)
177
177
  if defined?(RAILS_ENV)
178
178
  Object.send(:remove_const, :RAILS_ENV)
@@ -299,7 +299,7 @@ private
299
299
  # used).
300
300
  def self.start_request_handler(channel, forked, options)
301
301
  app_root = options["app_root"]
302
- $0 = "Rails: #{app_root}"
302
+ $0 = "Rails: #{options['app_group_name']}"
303
303
  reader, writer = IO.pipe
304
304
  begin
305
305
  reader.close_on_exec!
@@ -224,7 +224,12 @@ module Dependencies # :nodoc: all
224
224
  require 'rbconfig'
225
225
  begin
226
226
  require 'mkmf'
227
- header_dir = Config::CONFIG['rubyhdrdir'] || Config::CONFIG['archdir']
227
+ if defined?(::RbConfig)
228
+ config = ::RbConfig::CONFIG
229
+ else
230
+ config = ::Config::CONFIG
231
+ end
232
+ header_dir = config['rubyhdrdir'] || config['archdir']
228
233
  result.found(File.exist?("#{header_dir}/ruby.h"))
229
234
  rescue LoadError, SystemExit
230
235
  # On RedHat/Fedora/CentOS, if ruby-devel is not installed then