passenger 6.0.4 → 6.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +86 -1
  3. data/CONTRIBUTING.md +1 -1
  4. data/CONTRIBUTORS +3 -0
  5. data/bin/passenger-install-nginx-module +1 -1
  6. data/bin/passenger-memory-stats +65 -12
  7. data/passenger.gemspec +9 -1
  8. data/resources/templates/error_renderer/with_details/dist/bundle.js +1 -1
  9. data/resources/templates/error_renderer/with_details/src/GetHelpView.jsx +1 -1
  10. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.css +0 -0
  11. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.js +0 -0
  12. data/resources/templates/error_renderer/with_details/src/bootstrap/config.json +0 -0
  13. data/resources/templates/standalone/rails_asset_pipeline.erb +1 -1
  14. data/resources/templates/standalone/server.erb +1 -0
  15. data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
  16. data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +2 -0
  17. data/src/agent/Core/ApplicationPool/Implementation.cpp +0 -1
  18. data/src/agent/Core/ApplicationPool/Options.h +19 -0
  19. data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +1 -1
  20. data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
  21. data/src/agent/Core/Config.h +3 -1
  22. data/src/agent/Core/Controller.h +1 -0
  23. data/src/agent/Core/Controller/Config.h +9 -1
  24. data/src/agent/Core/Controller/ForwardResponse.cpp +13 -0
  25. data/src/agent/Core/Controller/InitRequest.cpp +5 -0
  26. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -0
  27. data/src/agent/Core/OptionParser.h +3 -0
  28. data/src/agent/Core/SpawningKit/Config.h +11 -0
  29. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +13 -0
  30. data/src/agent/Core/SpawningKit/Spawner.h +1 -0
  31. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +2 -0
  32. data/src/agent/Watchdog/Config.h +3 -1
  33. data/src/apache2_module/Config.cpp +1 -1
  34. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +10 -0
  35. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +10 -0
  36. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +25 -0
  37. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +10 -0
  38. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +6 -0
  39. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +26 -0
  40. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +14 -0
  41. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +34 -0
  42. data/src/apache2_module/Hooks.cpp +4 -0
  43. data/src/cxx_supportlib/Constants.h +4 -2
  44. data/src/cxx_supportlib/Hooks.h +1 -0
  45. data/src/cxx_supportlib/oxt/system_calls.cpp +10 -10
  46. data/src/cxx_supportlib/vendor-modified/modp_b64_data.h +0 -4
  47. data/src/cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp +5 -1
  48. data/src/helper-scripts/node-loader.js +1 -1
  49. data/src/helper-scripts/prespawn +1 -0
  50. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +24 -0
  51. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +14 -0
  52. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +24 -0
  53. data/src/nginx_module/Configuration.c +7 -3
  54. data/src/nginx_module/ContentHandler.c +0 -2
  55. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +16 -0
  56. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +30 -0
  57. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +29 -0
  58. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +6 -0
  59. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +11 -0
  60. data/src/nginx_module/ngx_http_passenger_module.c +2 -2
  61. data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/logger.js +0 -0
  62. data/src/ruby_supportlib/phusion_passenger.rb +8 -8
  63. data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +1 -1
  64. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +15 -0
  65. data/src/ruby_supportlib/phusion_passenger/constants.rb +3 -1
  66. data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +4 -2
  67. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +20 -0
  68. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +1 -1
  69. data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +1 -1
  70. data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +10 -0
  71. data/src/ruby_supportlib/phusion_passenger/request_handler.rb +7 -6
  72. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +13 -0
  73. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +3 -2
  74. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +1 -1
  75. data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +15 -11
  76. metadata +11 -4
@@ -176,6 +176,19 @@ ConfigManifestGenerator::autoGenerated_generateConfigManifestForDirConfig(server
176
176
  pdconf->mBufferUploadSourceLine);
177
177
  hierarchyMember["value"] = pdconf->mBufferUpload == Apache2Module::ENABLED;
178
178
  }
179
+ if (pdconf->mDirectInstanceRequestAddressExplicitlySet) {
180
+ findOrCreateAppAndLocOptionsContainers(serverRec, csconf, cdconf,
181
+ pdconf, context, &appOptionsContainer, &locOptionsContainer);
182
+ Json::Value &optionContainer = findOrCreateOptionContainer(*appOptionsContainer,
183
+ "PassengerDirectInstanceRequestAddress",
184
+ sizeof("PassengerDirectInstanceRequestAddress") - 1);
185
+ Json::Value &hierarchyMember = addOptionContainerHierarchyMember(optionContainer,
186
+ pdconf->mDirectInstanceRequestAddressSourceFile,
187
+ pdconf->mDirectInstanceRequestAddressSourceLine);
188
+ hierarchyMember["value"] = Json::Value(
189
+ pdconf->mDirectInstanceRequestAddress.data(),
190
+ pdconf->mDirectInstanceRequestAddress.data() + pdconf->mDirectInstanceRequestAddress.size());
191
+ }
179
192
  if (pdconf->mEnabledExplicitlySet) {
180
193
  findOrCreateAppAndLocOptionsContainers(serverRec, csconf, cdconf,
181
194
  pdconf, context, &appOptionsContainer, &locOptionsContainer);
@@ -435,6 +448,19 @@ ConfigManifestGenerator::autoGenerated_generateConfigManifestForDirConfig(server
435
448
  pdconf->mStickySessionsSourceLine);
436
449
  hierarchyMember["value"] = pdconf->mStickySessions == Apache2Module::ENABLED;
437
450
  }
451
+ if (pdconf->mStickySessionsCookieAttributesExplicitlySet) {
452
+ findOrCreateAppAndLocOptionsContainers(serverRec, csconf, cdconf,
453
+ pdconf, context, &appOptionsContainer, &locOptionsContainer);
454
+ Json::Value &optionContainer = findOrCreateOptionContainer(*locOptionsContainer,
455
+ "PassengerStickySessionsCookieAttributes",
456
+ sizeof("PassengerStickySessionsCookieAttributes") - 1);
457
+ Json::Value &hierarchyMember = addOptionContainerHierarchyMember(optionContainer,
458
+ pdconf->mStickySessionsCookieAttributesSourceFile,
459
+ pdconf->mStickySessionsCookieAttributesSourceLine);
460
+ hierarchyMember["value"] = Json::Value(
461
+ pdconf->mStickySessionsCookieAttributes.data(),
462
+ pdconf->mStickySessionsCookieAttributes.data() + pdconf->mStickySessionsCookieAttributes.size());
463
+ }
438
464
  if (pdconf->mStickySessionsCookieNameExplicitlySet) {
439
465
  findOrCreateAppAndLocOptionsContainers(serverRec, csconf, cdconf,
440
466
  pdconf, context, &appOptionsContainer, &locOptionsContainer);
@@ -88,6 +88,10 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
88
88
  (add->mBufferUpload != Apache2Module::UNSET)
89
89
  ? add->mBufferUpload
90
90
  : base->mBufferUpload;
91
+ config->mDirectInstanceRequestAddress =
92
+ (!add->mDirectInstanceRequestAddress.empty())
93
+ ? add->mDirectInstanceRequestAddress
94
+ : base->mDirectInstanceRequestAddress;
91
95
  config->mEnabled =
92
96
  (add->mEnabled != Apache2Module::UNSET)
93
97
  ? add->mEnabled
@@ -176,6 +180,10 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
176
180
  (add->mStickySessions != Apache2Module::UNSET)
177
181
  ? add->mStickySessions
178
182
  : base->mStickySessions;
183
+ config->mStickySessionsCookieAttributes =
184
+ (!add->mStickySessionsCookieAttributes.empty())
185
+ ? add->mStickySessionsCookieAttributes
186
+ : base->mStickySessionsCookieAttributes;
179
187
  config->mStickySessionsCookieName =
180
188
  (!add->mStickySessionsCookieName.empty())
181
189
  ? add->mStickySessionsCookieName
@@ -195,6 +203,7 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
195
203
  config->mBaseURIsSourceFile = add->mBaseURIsSourceFile;
196
204
  config->mBufferResponseSourceFile = add->mBufferResponseSourceFile;
197
205
  config->mBufferUploadSourceFile = add->mBufferUploadSourceFile;
206
+ config->mDirectInstanceRequestAddressSourceFile = add->mDirectInstanceRequestAddressSourceFile;
198
207
  config->mEnabledSourceFile = add->mEnabledSourceFile;
199
208
  config->mErrorOverrideSourceFile = add->mErrorOverrideSourceFile;
200
209
  config->mForceMaxConcurrentRequestsPerProcessSourceFile = add->mForceMaxConcurrentRequestsPerProcessSourceFile;
@@ -217,6 +226,7 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
217
226
  config->mStartTimeoutSourceFile = add->mStartTimeoutSourceFile;
218
227
  config->mStartupFileSourceFile = add->mStartupFileSourceFile;
219
228
  config->mStickySessionsSourceFile = add->mStickySessionsSourceFile;
229
+ config->mStickySessionsCookieAttributesSourceFile = add->mStickySessionsCookieAttributesSourceFile;
220
230
  config->mStickySessionsCookieNameSourceFile = add->mStickySessionsCookieNameSourceFile;
221
231
  config->mUserSourceFile = add->mUserSourceFile;
222
232
 
@@ -230,6 +240,7 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
230
240
  config->mBaseURIsSourceLine = add->mBaseURIsSourceLine;
231
241
  config->mBufferResponseSourceLine = add->mBufferResponseSourceLine;
232
242
  config->mBufferUploadSourceLine = add->mBufferUploadSourceLine;
243
+ config->mDirectInstanceRequestAddressSourceLine = add->mDirectInstanceRequestAddressSourceLine;
233
244
  config->mEnabledSourceLine = add->mEnabledSourceLine;
234
245
  config->mErrorOverrideSourceLine = add->mErrorOverrideSourceLine;
235
246
  config->mForceMaxConcurrentRequestsPerProcessSourceLine = add->mForceMaxConcurrentRequestsPerProcessSourceLine;
@@ -252,6 +263,7 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
252
263
  config->mStartTimeoutSourceLine = add->mStartTimeoutSourceLine;
253
264
  config->mStartupFileSourceLine = add->mStartupFileSourceLine;
254
265
  config->mStickySessionsSourceLine = add->mStickySessionsSourceLine;
266
+ config->mStickySessionsCookieAttributesSourceLine = add->mStickySessionsCookieAttributesSourceLine;
255
267
  config->mStickySessionsCookieNameSourceLine = add->mStickySessionsCookieNameSourceLine;
256
268
  config->mUserSourceLine = add->mUserSourceLine;
257
269
 
@@ -265,6 +277,7 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
265
277
  config->mBaseURIsExplicitlySet = add->mBaseURIsExplicitlySet;
266
278
  config->mBufferResponseExplicitlySet = add->mBufferResponseExplicitlySet;
267
279
  config->mBufferUploadExplicitlySet = add->mBufferUploadExplicitlySet;
280
+ config->mDirectInstanceRequestAddressExplicitlySet = add->mDirectInstanceRequestAddressExplicitlySet;
268
281
  config->mEnabledExplicitlySet = add->mEnabledExplicitlySet;
269
282
  config->mErrorOverrideExplicitlySet = add->mErrorOverrideExplicitlySet;
270
283
  config->mForceMaxConcurrentRequestsPerProcessExplicitlySet = add->mForceMaxConcurrentRequestsPerProcessExplicitlySet;
@@ -287,6 +300,7 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
287
300
  config->mStartTimeoutExplicitlySet = add->mStartTimeoutExplicitlySet;
288
301
  config->mStartupFileExplicitlySet = add->mStartupFileExplicitlySet;
289
302
  config->mStickySessionsExplicitlySet = add->mStickySessionsExplicitlySet;
303
+ config->mStickySessionsCookieAttributesExplicitlySet = add->mStickySessionsCookieAttributesExplicitlySet;
290
304
  config->mStickySessionsCookieNameExplicitlySet = add->mStickySessionsCookieNameExplicitlySet;
291
305
  config->mUserExplicitlySet = add->mUserExplicitlySet;
292
306
  }
@@ -166,6 +166,11 @@ struct AutoGeneratedDirConfig {
166
166
  */
167
167
  StaticString mAppType;
168
168
 
169
+ /*
170
+ * The address that Passenger binds to in order to allow sending HTTP requests to individual application processes.
171
+ */
172
+ StaticString mDirectInstanceRequestAddress;
173
+
169
174
  /*
170
175
  * The group that Ruby applications must run as.
171
176
  */
@@ -206,6 +211,11 @@ struct AutoGeneratedDirConfig {
206
211
  */
207
212
  StaticString mStartupFile;
208
213
 
214
+ /*
215
+ * The attributes to use for the sticky session cookie.
216
+ */
217
+ StaticString mStickySessionsCookieAttributes;
218
+
209
219
  /*
210
220
  * The cookie name to use for sticky sessions.
211
221
  */
@@ -249,6 +259,7 @@ struct AutoGeneratedDirConfig {
249
259
  StaticString mAppRootSourceFile;
250
260
  StaticString mAppStartCommandSourceFile;
251
261
  StaticString mAppTypeSourceFile;
262
+ StaticString mDirectInstanceRequestAddressSourceFile;
252
263
  StaticString mGroupSourceFile;
253
264
  StaticString mMeteorAppSettingsSourceFile;
254
265
  StaticString mNodejsSourceFile;
@@ -257,6 +268,7 @@ struct AutoGeneratedDirConfig {
257
268
  StaticString mRubySourceFile;
258
269
  StaticString mSpawnMethodSourceFile;
259
270
  StaticString mStartupFileSourceFile;
271
+ StaticString mStickySessionsCookieAttributesSourceFile;
260
272
  StaticString mStickySessionsCookieNameSourceFile;
261
273
  StaticString mUserSourceFile;
262
274
  StaticString mBaseURIsSourceFile;
@@ -284,6 +296,7 @@ struct AutoGeneratedDirConfig {
284
296
  unsigned int mAppRootSourceLine;
285
297
  unsigned int mAppStartCommandSourceLine;
286
298
  unsigned int mAppTypeSourceLine;
299
+ unsigned int mDirectInstanceRequestAddressSourceLine;
287
300
  unsigned int mGroupSourceLine;
288
301
  unsigned int mMeteorAppSettingsSourceLine;
289
302
  unsigned int mNodejsSourceLine;
@@ -292,6 +305,7 @@ struct AutoGeneratedDirConfig {
292
305
  unsigned int mRubySourceLine;
293
306
  unsigned int mSpawnMethodSourceLine;
294
307
  unsigned int mStartupFileSourceLine;
308
+ unsigned int mStickySessionsCookieAttributesSourceLine;
295
309
  unsigned int mStickySessionsCookieNameSourceLine;
296
310
  unsigned int mUserSourceLine;
297
311
  unsigned int mBaseURIsSourceLine;
@@ -319,6 +333,7 @@ struct AutoGeneratedDirConfig {
319
333
  bool mAppRootExplicitlySet: 1;
320
334
  bool mAppStartCommandExplicitlySet: 1;
321
335
  bool mAppTypeExplicitlySet: 1;
336
+ bool mDirectInstanceRequestAddressExplicitlySet: 1;
322
337
  bool mGroupExplicitlySet: 1;
323
338
  bool mMeteorAppSettingsExplicitlySet: 1;
324
339
  bool mNodejsExplicitlySet: 1;
@@ -327,6 +342,7 @@ struct AutoGeneratedDirConfig {
327
342
  bool mRubyExplicitlySet: 1;
328
343
  bool mSpawnMethodExplicitlySet: 1;
329
344
  bool mStartupFileExplicitlySet: 1;
345
+ bool mStickySessionsCookieAttributesExplicitlySet: 1;
330
346
  bool mStickySessionsCookieNameExplicitlySet: 1;
331
347
  bool mUserExplicitlySet: 1;
332
348
  bool mBaseURIsExplicitlySet: 1;
@@ -507,6 +523,15 @@ struct AutoGeneratedDirConfig {
507
523
  return mAppType;
508
524
  }
509
525
 
526
+ StaticString
527
+ getDirectInstanceRequestAddress() const {
528
+ if (mDirectInstanceRequestAddress.empty()) {
529
+ return P_STATIC_STRING("127.0.0.1");
530
+ } else {
531
+ return mDirectInstanceRequestAddress;
532
+ }
533
+ }
534
+
510
535
  StaticString
511
536
  getGroup() const {
512
537
  return mGroup;
@@ -563,6 +588,15 @@ struct AutoGeneratedDirConfig {
563
588
  return mStartupFile;
564
589
  }
565
590
 
591
+ StaticString
592
+ getStickySessionsCookieAttributes() const {
593
+ if (mStickySessionsCookieAttributes.empty()) {
594
+ return DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES;
595
+ } else {
596
+ return mStickySessionsCookieAttributes;
597
+ }
598
+ }
599
+
566
600
  StaticString
567
601
  getStickySessionsCookieName() const {
568
602
  if (mStickySessionsCookieName.empty()) {
@@ -1020,6 +1020,10 @@ private:
1020
1020
  env = (apr_table_entry_t*) env_arr->elts;
1021
1021
 
1022
1022
  for (i = 0; i < env_arr->nelts; ++i) {
1023
+ if ((strcmp(env[i].key, "SCRIPT_NAME") == 0)
1024
+ || (strcmp(env[i].key, "PATH_INFO") == 0)) {
1025
+ continue;
1026
+ }
1023
1027
  envvarsData.append(env[i].key);
1024
1028
  envvarsData.append("\0", 1);
1025
1029
  if (env[i].val != NULL) {
@@ -48,6 +48,7 @@
48
48
  #define DEFAULT_APP_OUTPUT_LOG_LEVEL 3
49
49
  #define DEFAULT_APP_OUTPUT_LOG_LEVEL_NAME "notice"
50
50
  #define DEFAULT_APP_THREAD_COUNT 1
51
+ #define DEFAULT_BIND_ADDRESS "127.0.0.1"
51
52
  #define DEFAULT_CONCURRENCY_MODEL "process"
52
53
  #define DEFAULT_FILE_BUFFERED_CHANNEL_THRESHOLD 131072
53
54
  #define DEFAULT_HTTP_SERVER_LISTEN_ADDRESS "tcp://127.0.0.1:3000"
@@ -68,9 +69,10 @@
68
69
  #define DEFAULT_SPAWN_METHOD "smart"
69
70
  #define DEFAULT_START_TIMEOUT 90000
70
71
  #define DEFAULT_STAT_THROTTLE_RATE 10
72
+ #define DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES "SameSite=Lax; Secure;"
71
73
  #define DEFAULT_STICKY_SESSIONS_COOKIE_NAME "_passenger_route"
72
74
  #define DEFAULT_WEB_APP_USER "nobody"
73
- #define ENTERPRISE_URL "https://www.phusionpassenger.com/enterprise"
75
+ #define ENTERPRISE_URL "https://www.phusionpassenger.com/features#premium-features"
74
76
  #define FEEDBACK_FD 3
75
77
  #define FLYING_PASSENGER_NAME "Flying Passenger"
76
78
  #define GLOBAL_NAMESPACE_DIRNAME "passenger"
@@ -81,7 +83,7 @@
81
83
  #define PASSENGER_API_VERSION_MAJOR 0
82
84
  #define PASSENGER_API_VERSION_MINOR 3
83
85
  #define PASSENGER_DEFAULT_USER "nobody"
84
- #define PASSENGER_VERSION "6.0.4"
86
+ #define PASSENGER_VERSION "6.0.7"
85
87
  #define POOL_HELPER_THREAD_STACK_SIZE 262144
86
88
  #define PROCESS_SHUTDOWN_TIMEOUT 60
87
89
  #define PROCESS_SHUTDOWN_TIMEOUT_DISPLAY "1 minute"
@@ -80,6 +80,7 @@ namespace {
80
80
  key.append(1, toupper(*data));
81
81
  data++;
82
82
  }
83
+ if (key == "PASSENGER_CONFIG_MANIFEST") continue;
83
84
  switch (it->type()) {
84
85
  case Json::nullValue:
85
86
  case Json::stringValue:
@@ -132,15 +132,15 @@ shouldSimulateFailure() {
132
132
  _my_errno = errno; \
133
133
  } while ((error_expression) \
134
134
  && _my_errno == EINTR \
135
- && (!this_thread::syscalls_interruptable() \
136
- || !(_intr_requested = this_thread::interruption_requested())) \
135
+ && (!boost::this_thread::syscalls_interruptable() \
136
+ || !(_intr_requested = boost::this_thread::interruption_requested())) \
137
137
  ); \
138
138
  if (OXT_LIKELY(ctx != NULL)) { \
139
139
  ctx->syscall_interruption_lock.lock(); \
140
140
  } \
141
141
  if ((error_expression) \
142
142
  && _my_errno == EINTR \
143
- && this_thread::syscalls_interruptable() \
143
+ && boost::this_thread::syscalls_interruptable() \
144
144
  && _intr_requested) { \
145
145
  throw thread_interrupted(); \
146
146
  } \
@@ -284,8 +284,8 @@ syscalls::close(int fd) {
284
284
  }
285
285
  if (ret == -1
286
286
  && errno == EINTR
287
- && this_thread::syscalls_interruptable()
288
- && this_thread::interruption_requested()) {
287
+ && boost::this_thread::syscalls_interruptable()
288
+ && boost::this_thread::interruption_requested()) {
289
289
  throw thread_interrupted();
290
290
  } else {
291
291
  return ret;
@@ -662,8 +662,8 @@ syscalls::nanosleep(const struct timespec *req, struct timespec *rem) {
662
662
  }
663
663
  } while (ret == -1
664
664
  && e == EINTR
665
- && (!this_thread::syscalls_interruptable()
666
- || !(intr_requested = this_thread::interruption_requested()))
665
+ && (!boost::this_thread::syscalls_interruptable()
666
+ || !(intr_requested = boost::this_thread::interruption_requested()))
667
667
  );
668
668
 
669
669
  if (OXT_UNLIKELY(ctx != NULL)) {
@@ -672,7 +672,7 @@ syscalls::nanosleep(const struct timespec *req, struct timespec *rem) {
672
672
 
673
673
  if (ret == -1
674
674
  && e == EINTR
675
- && this_thread::syscalls_interruptable()
675
+ && boost::this_thread::syscalls_interruptable()
676
676
  && intr_requested) {
677
677
  throw thread_interrupted();
678
678
  }
@@ -748,14 +748,14 @@ syscalls::waitpid(pid_t pid, int *status, int options) {
748
748
  * http://stackoverflow.com/questions/20410943/segmentation-fault-when-accessing-statically-initialized-thread-variable?noredirect=1#comment30483943_20410943
749
749
  * https://bugzilla.redhat.com/show_bug.cgi?id=731228
750
750
  */
751
- __thread int this_thread::_syscalls_interruptable = 1;
751
+ __thread int boost::this_thread::_syscalls_interruptable = 1;
752
752
 
753
753
  bool
754
754
  boost::this_thread::syscalls_interruptable() {
755
755
  return _syscalls_interruptable;
756
756
  }
757
757
  #else
758
- boost::thread_specific_ptr<bool> this_thread::_syscalls_interruptable;
758
+ boost::thread_specific_ptr<bool> boost::this_thread::_syscalls_interruptable;
759
759
 
760
760
  bool
761
761
  boost::this_thread::syscalls_interruptable() {
@@ -11,10 +11,6 @@
11
11
  typedef uint32_t modp_uint32_t;
12
12
  #endif
13
13
 
14
- #ifndef MODP_B64_DONT_INCLUDE_BOOST_ENDIANNESS_HEADERS
15
- #include <boost/detail/endian.hpp>
16
- #endif
17
-
18
14
  /**
19
15
  * you can control if we use padding by commenting out this
20
16
  * next line. However, I highly recommend you use padding and not
@@ -26,6 +26,10 @@
26
26
 
27
27
  #include "modp_b64_data.h"
28
28
 
29
+ #ifndef MODP_B64_DONT_INCLUDE_BOOST_ENDIANNESS_HEADERS
30
+ #include <boost/predef/other/endian.h>
31
+ #endif
32
+
29
33
  /* public header */
30
34
  #include "modp_b64.h"
31
35
 
@@ -85,7 +89,7 @@ size_t modp_b64_decode(char* dest, const char* src, size_t len)
85
89
  case 0:
86
90
  x = d0[y[3]] | d1[y[2]] | d2[y[1]] | d3[y[0]];
87
91
  if (x >= B64_BADCHAR) return -1;
88
- #ifdef BOOST_BIG_ENDIAN
92
+ #ifdef BOOST_ENDIAN_BIG_BYTE
89
93
  *p++ = ((modp_uint8_t*)&x)[1];
90
94
  *p++ = ((modp_uint8_t*)&x)[2];
91
95
  *p = ((modp_uint8_t*)&x)[3];
@@ -135,7 +135,7 @@ setupEnvironment(options);
135
135
 
136
136
  function tryWriteFile(path, contents) {
137
137
  try {
138
- fs.writeFileSync(path, contents);
138
+ fs.writeFileSync(path, contents.toString());
139
139
  } catch (e) {
140
140
  console.error('Warning: unable to write to ' + path + ': ' + e.message);
141
141
  }
@@ -107,6 +107,7 @@ class PrespawnLocation
107
107
  def head_request
108
108
  socket.write("HEAD #{request_path} HTTP/1.1\r\n")
109
109
  socket.write("Host: #{request_host}\r\n")
110
+ socket.write("User-Agent: Passenger Prespawn Script\r\n")
110
111
  socket.write("Authorization: Basic " + base64(@uri.userinfo) + "\r\n") if @uri.userinfo
111
112
  socket.write("Connection: close\r\n")
112
113
  socket.write("\r\n")
@@ -446,6 +446,14 @@
446
446
  offsetof(passenger_loc_conf_t, autogenerated.spawn_method),
447
447
  NULL
448
448
  },
449
+ {
450
+ ngx_string("passenger_direct_instance_request_address"),
451
+ NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
452
+ passenger_conf_set_direct_instance_request_address,
453
+ NGX_HTTP_LOC_CONF_OFFSET,
454
+ offsetof(passenger_loc_conf_t, autogenerated.direct_instance_request_address),
455
+ NULL
456
+ },
449
457
  {
450
458
  ngx_string("passenger_load_shell_envvars"),
451
459
  NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
@@ -542,6 +550,14 @@
542
550
  offsetof(passenger_loc_conf_t, autogenerated.document_root),
543
551
  NULL
544
552
  },
553
+ {
554
+ ngx_string("passenger_temp_path"),
555
+ NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
556
+ ngx_conf_set_path_slot,
557
+ NGX_HTTP_LOC_CONF_OFFSET,
558
+ offsetof(passenger_loc_conf_t, upstream_config.temp_path),
559
+ NULL
560
+ },
545
561
  {
546
562
  ngx_string("passenger_ignore_headers"),
547
563
  NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_1MORE,
@@ -678,6 +694,14 @@
678
694
  offsetof(passenger_loc_conf_t, autogenerated.sticky_sessions_cookie_name),
679
695
  NULL
680
696
  },
697
+ {
698
+ ngx_string("passenger_sticky_sessions_cookie_attributes"),
699
+ NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
700
+ passenger_conf_set_sticky_sessions_cookie_attributes,
701
+ NGX_HTTP_LOC_CONF_OFFSET,
702
+ offsetof(passenger_loc_conf_t, autogenerated.sticky_sessions_cookie_attributes),
703
+ NULL
704
+ },
681
705
  {
682
706
  ngx_string("passenger_vary_turbocache_by_cookie"),
683
707
  NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
@@ -280,6 +280,13 @@ set_manifest_autogenerated_app_conf_defaults(manifest_gen_ctx_t *ctx, PsgJsonVal
280
280
  "'smart' for Ruby apps, 'direct' for all other apps",
281
281
  sizeof("'smart' for Ruby apps, 'direct' for all other apps") - 1);
282
282
 
283
+ add_manifest_options_container_static_default_str(ctx,
284
+ options_container,
285
+ "passenger_direct_instance_request_address",
286
+ sizeof("passenger_direct_instance_request_address") - 1,
287
+ "127.0.0.1",
288
+ sizeof("127.0.0.1") - 1);
289
+
283
290
  add_manifest_options_container_static_default_bool(ctx,
284
291
  options_container,
285
292
  "passenger_load_shell_envvars",
@@ -430,5 +437,12 @@ set_manifest_autogenerated_loc_conf_defaults(manifest_gen_ctx_t *ctx, PsgJsonVal
430
437
  "_passenger_route",
431
438
  sizeof("_passenger_route") - 1);
432
439
 
440
+ add_manifest_options_container_static_default_str(ctx,
441
+ options_container,
442
+ "passenger_sticky_sessions_cookie_attributes",
443
+ sizeof("passenger_sticky_sessions_cookie_attributes") - 1,
444
+ "SameSite=Lax; Secure;",
445
+ sizeof("SameSite=Lax; Secure;") - 1);
446
+
433
447
  }
434
448