passenger 4.0.48 → 4.0.49
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.
- checksums.yaml +8 -8
- checksums.yaml.gz.asc +7 -7
- data.tar.gz.asc +7 -7
- data/.editorconfig +36 -2
- data/.travis.yml +1 -1
- data/CHANGELOG +16 -0
- data/Rakefile +0 -1
- data/build/apache2.rb +4 -4
- data/build/common_library.rb +18 -18
- data/build/cplusplus_support.rb +2 -2
- data/build/documentation.rb +1 -1
- data/build/integration_tests.rb +12 -4
- data/build/misc.rb +12 -7
- data/build/packaging.rb +14 -14
- data/build/preprocessor.rb +10 -10
- data/build/rake_extensions.rb +11 -11
- data/build/ruby_extension.rb +2 -2
- data/dev/ci/inituidgid +24 -0
- data/dev/ci/run_jenkins.sh +57 -0
- data/dev/ci/run_rpm_tests.sh +77 -0
- data/dev/{run_travis.sh → ci/run_travis.sh} +60 -4
- data/doc/Users guide Nginx.txt +2 -2
- data/doc/users_guide_snippets/environment_variables.txt +0 -2
- data/doc/users_guide_snippets/tips.txt +20 -1
- data/ext/apache2/Bucket.cpp +18 -18
- data/ext/apache2/Bucket.h +4 -4
- data/ext/apache2/Configuration.cpp +7 -7
- data/ext/apache2/Configuration.hpp +43 -43
- data/ext/apache2/DirectoryMapper.h +5 -5
- data/ext/apache2/Hooks.cpp +142 -142
- data/ext/apache2/MergeDirConfig.cpp +40 -40
- data/ext/common/Account.h +17 -17
- data/ext/common/AccountsDatabase.h +9 -9
- data/ext/common/AgentsStarter.cpp +2 -2
- data/ext/common/AgentsStarter.h +40 -40
- data/ext/common/ApplicationPool2/Common.h +10 -6
- data/ext/common/ApplicationPool2/ComponentInfo.h +2 -2
- data/ext/common/ApplicationPool2/DirectSpawner.h +17 -17
- data/ext/common/ApplicationPool2/DummySpawner.h +5 -5
- data/ext/common/ApplicationPool2/Group.h +54 -38
- data/ext/common/ApplicationPool2/Implementation.cpp +76 -49
- data/ext/common/ApplicationPool2/Options.h +98 -91
- data/ext/common/ApplicationPool2/Pool.h +70 -69
- data/ext/common/ApplicationPool2/Process.h +21 -21
- data/ext/common/ApplicationPool2/Session.h +11 -11
- data/ext/common/ApplicationPool2/SmartSpawner.h +60 -60
- data/ext/common/ApplicationPool2/Socket.h +19 -19
- data/ext/common/ApplicationPool2/Spawner.h +64 -72
- data/ext/common/ApplicationPool2/SpawnerFactory.h +4 -4
- data/ext/common/ApplicationPool2/SuperGroup.h +41 -41
- data/ext/common/BackgroundEventLoop.cpp +1 -1
- data/ext/common/BackgroundEventLoop.h +2 -2
- data/ext/common/Constants.h +1 -1
- data/ext/common/EventedBufferedInput.h +5 -5
- data/ext/common/EventedClient.h +51 -51
- data/ext/common/EventedMessageServer.h +39 -39
- data/ext/common/EventedServer.h +32 -32
- data/ext/common/Exceptions.h +23 -23
- data/ext/common/FileDescriptor.h +18 -18
- data/ext/common/Logging.cpp +1 -1
- data/ext/common/MessageClient.h +27 -27
- data/ext/common/MessageReadersWriters.h +79 -79
- data/ext/common/MessageServer.h +59 -59
- data/ext/common/RandomGenerator.h +12 -12
- data/ext/common/ResourceLocator.h +8 -8
- data/ext/common/SafeLibev.h +54 -25
- data/ext/common/ServerInstanceDir.h +31 -31
- data/ext/common/StaticString.h +50 -48
- data/ext/common/Utils.cpp +73 -78
- data/ext/common/Utils.h +6 -6
- data/ext/common/Utils/Base64.cpp +3 -3
- data/ext/common/Utils/Base64.h +7 -7
- data/ext/common/Utils/BlockingQueue.h +9 -9
- data/ext/common/Utils/BufferedIO.h +17 -17
- data/ext/common/Utils/CachedFileStat.hpp +16 -16
- data/ext/common/Utils/Dechunker.h +25 -25
- data/ext/common/Utils/FileChangeChecker.h +10 -10
- data/ext/common/Utils/MemZeroGuard.h +5 -5
- data/ext/common/Utils/MemoryBarrier.h +1 -1
- data/ext/common/Utils/MessageIO.h +61 -61
- data/ext/common/Utils/ProcessMetricsCollector.h +40 -40
- data/ext/common/Utils/ScopeGuard.h +7 -7
- data/ext/common/Utils/SpeedMeter.h +1 -1
- data/ext/common/Utils/StrIntUtils.cpp +13 -13
- data/ext/common/Utils/StrIntUtils.h +3 -3
- data/ext/common/Utils/StringScanning.h +5 -5
- data/ext/common/Utils/SystemMetricsCollector.h +2 -2
- data/ext/common/Utils/SystemTime.h +10 -10
- data/ext/common/Utils/Template.h +2 -2
- data/ext/common/Utils/Timer.h +6 -6
- data/ext/common/Utils/VariantMap.h +29 -29
- data/ext/common/agents/Base.cpp +19 -19
- data/ext/common/agents/HelperAgent/AgentOptions.h +1 -1
- data/ext/common/agents/HelperAgent/FileBackedPipe.h +6 -6
- data/ext/common/agents/HelperAgent/Main.cpp +44 -43
- data/ext/common/agents/HelperAgent/RequestHandler.cpp +4 -4
- data/ext/common/agents/HelperAgent/RequestHandler.h +29 -28
- data/ext/common/agents/HelperAgent/ScgiRequestParser.h +56 -50
- data/ext/common/agents/LoggingAgent/AdminController.h +8 -8
- data/ext/common/agents/LoggingAgent/DataStoreId.h +17 -17
- data/ext/common/agents/LoggingAgent/FilterSupport.h +167 -167
- data/ext/common/agents/LoggingAgent/LoggingServer.h +122 -122
- data/ext/common/agents/LoggingAgent/Main.cpp +7 -7
- data/ext/common/agents/LoggingAgent/RemoteSender.h +54 -54
- data/ext/common/agents/SpawnPreparer.cpp +4 -4
- data/ext/common/agents/TempDirToucher.c +2 -2
- data/ext/common/agents/Watchdog/AgentWatcher.cpp +47 -47
- data/ext/common/agents/Watchdog/HelperAgentWatcher.cpp +7 -7
- data/ext/common/agents/Watchdog/LoggingAgentWatcher.cpp +7 -7
- data/ext/common/agents/Watchdog/Main.cpp +22 -22
- data/ext/common/agents/Watchdog/ServerInstanceDirToucher.cpp +9 -9
- data/ext/libeio/eio.c +1 -1
- data/ext/nginx/Configuration.c +30 -30
- data/ext/nginx/Configuration.h +1 -1
- data/ext/nginx/ContentHandler.c +54 -54
- data/ext/nginx/ContentHandler.h +3 -3
- data/ext/nginx/StaticContentHandler.c +2 -2
- data/ext/nginx/ngx_http_passenger_module.c +21 -21
- data/ext/oxt/detail/backtrace_enabled.hpp +1 -1
- data/ext/oxt/detail/context.hpp +1 -1
- data/ext/oxt/detail/spin_lock_darwin.hpp +4 -4
- data/ext/oxt/detail/spin_lock_gcc_x86.hpp +3 -3
- data/ext/oxt/detail/spin_lock_pthreads.hpp +4 -4
- data/ext/oxt/detail/tracable_exception_disabled.hpp +1 -1
- data/ext/oxt/dynamic_thread_group.hpp +18 -18
- data/ext/oxt/implementation.cpp +9 -8
- data/ext/oxt/macros.hpp +2 -2
- data/ext/oxt/system_calls.cpp +11 -11
- data/ext/oxt/system_calls.hpp +13 -13
- data/ext/oxt/thread.hpp +22 -14
- data/ext/ruby/passenger_native_support.c +55 -55
- data/lib/phusion_passenger.rb +24 -24
- data/lib/phusion_passenger/common_library.rb +2 -0
- data/lib/phusion_passenger/loader_shared_helpers.rb +18 -18
- data/lib/phusion_passenger/packaging.rb +9 -4
- data/lib/phusion_passenger/platform_info/apache.rb +45 -31
- data/lib/phusion_passenger/platform_info/compiler.rb +11 -11
- data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
- data/lib/phusion_passenger/request_handler/thread_handler.rb +8 -8
- data/lib/phusion_passenger/standalone/app_finder.rb +16 -16
- data/lib/phusion_passenger/standalone/command.rb +22 -22
- data/packaging/rpm/LICENSE.txt +19 -0
- data/packaging/rpm/Makefile +13 -0
- data/packaging/rpm/README.md +41 -0
- data/packaging/rpm/Vagrantfile +38 -0
- data/{rpm/Vagrantfile → packaging/rpm/Vagrantfile.centos} +0 -0
- data/packaging/rpm/build +170 -0
- data/packaging/rpm/create_project +41 -0
- data/packaging/rpm/git_update +88 -0
- data/packaging/rpm/image/Dockerfile +37 -0
- data/packaging/rpm/image/Gemfile +3 -0
- data/packaging/rpm/image/Gemfile.lock +12 -0
- data/packaging/rpm/image/RPM-GPG-KEY-amazon-ga +19 -0
- data/packaging/rpm/image/amazon2014-i386.cfg +96 -0
- data/packaging/rpm/image/amazon2014-x86_64.cfg +96 -0
- data/packaging/rpm/image/site-defaults.cfg +168 -0
- data/packaging/rpm/internal/build_tasks.rb +238 -0
- data/packaging/rpm/internal/dummygpg +11 -0
- data/packaging/rpm/internal/exec_build +42 -0
- data/packaging/rpm/internal/get_distro_arch +14 -0
- data/packaging/rpm/internal/get_distro_id +10 -0
- data/packaging/rpm/internal/git_update +27 -0
- data/packaging/rpm/internal/inituidgid +17 -0
- data/packaging/rpm/internal/my_init +344 -0
- data/packaging/rpm/internal/python27 +3 -0
- data/packaging/rpm/internal/repo_update +46 -0
- data/packaging/rpm/internal/setuser +26 -0
- data/packaging/rpm/internal/tracking_helper +40 -0
- data/packaging/rpm/jenkins_release +99 -0
- data/packaging/rpm/lib/build_tasks_support.rb +402 -0
- data/packaging/rpm/lib/preprocessor.rb +341 -0
- data/packaging/rpm/nginx_spec/404.html +119 -0
- data/packaging/rpm/nginx_spec/50x.html +119 -0
- data/packaging/rpm/nginx_spec/index.html +116 -0
- data/packaging/rpm/nginx_spec/nginx-auto-cc-gcc.patch +13 -0
- data/packaging/rpm/nginx_spec/nginx-logo.png +0 -0
- data/packaging/rpm/nginx_spec/nginx-upgrade +13 -0
- data/packaging/rpm/nginx_spec/nginx-upgrade.8 +151 -0
- data/packaging/rpm/nginx_spec/nginx.conf +131 -0
- data/packaging/rpm/nginx_spec/nginx.init +144 -0
- data/packaging/rpm/nginx_spec/nginx.logrotate +13 -0
- data/packaging/rpm/nginx_spec/nginx.service +15 -0
- data/packaging/rpm/nginx_spec/nginx.spec.template +559 -0
- data/packaging/rpm/nginx_spec/nginx.sysconfig +4 -0
- data/packaging/rpm/nginx_spec/passenger.conf +9 -0
- data/packaging/rpm/nginx_spec/poweredby.png +0 -0
- data/{rpm → packaging/rpm/passenger_spec}/apache-passenger.conf.in +0 -0
- data/{rpm → packaging/rpm/passenger_spec}/config.json +0 -0
- data/{rpm → packaging/rpm/passenger_spec}/passenger.logrotate +0 -0
- data/{rpm → packaging/rpm/passenger_spec}/passenger.spec.template +58 -31
- data/{rpm → packaging/rpm/passenger_spec}/passenger_dynamic_thread_group.patch +0 -0
- data/{rpm → packaging/rpm/passenger_spec}/passenger_tests_default_config_example.patch +0 -0
- data/{rpm → packaging/rpm/passenger_spec}/rubygem-passenger-4.0.18-GLIBC_HAVE_LONG_LONG.patch +0 -0
- data/{rpm → packaging/rpm/passenger_spec}/rubygem-passenger-4.0.18-gcc47-include-sys_types.patch +0 -0
- data/packaging/rpm/repo_update +114 -0
- data/packaging/rpm/setup-system +60 -0
- data/packaging/rpm/shell +10 -0
- data/resources/templates/standalone/config.erb +3 -1
- data/test/config.json.rpm-automation +1 -1
- data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +11 -11
- data/test/cxx/ApplicationPool2/OptionsTest.cpp +5 -5
- data/test/cxx/ApplicationPool2/PoolTest.cpp +129 -89
- data/test/cxx/ApplicationPool2/ProcessTest.cpp +15 -15
- data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +22 -22
- data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +11 -11
- data/test/cxx/ScgiRequestParserTest.cpp +75 -61
- data/test/cxx/UtilsTest.cpp +86 -85
- data/test/gdbinit.example +3 -0
- data/test/integration_tests/nginx_tests.rb +3 -3
- data/test/integration_tests/source_packaging_test.rb +3 -1
- data/test/stub/nginx/nginx.conf.erb +8 -1
- data/test/support/nginx_controller.rb +7 -7
- metadata +62 -17
- metadata.gz.asc +7 -7
- data/build/rpm.rb +0 -128
- data/dev/rpmtool +0 -21
- data/dev/test_rpm_packaging.sh +0 -28
- data/rpm/get_distro_id.py +0 -4
@@ -169,7 +169,7 @@ setOomScore(const StaticString &score) {
|
|
169
169
|
|
170
170
|
FILE *f;
|
171
171
|
OomFileType type;
|
172
|
-
|
172
|
+
|
173
173
|
f = openOomAdjFile("w", type);
|
174
174
|
if (f != NULL) {
|
175
175
|
size_t ret = fwrite(score.data(), 1, score.size(), f);
|
@@ -188,7 +188,7 @@ setOomScoreNeverKill() {
|
|
188
188
|
string oldScore;
|
189
189
|
FILE *f;
|
190
190
|
OomFileType type;
|
191
|
-
|
191
|
+
|
192
192
|
f = openOomAdjFile("r", type);
|
193
193
|
if (f == NULL) {
|
194
194
|
return "";
|
@@ -207,7 +207,7 @@ setOomScoreNeverKill() {
|
|
207
207
|
}
|
208
208
|
}
|
209
209
|
fclose(f);
|
210
|
-
|
210
|
+
|
211
211
|
f = openOomAdjFile("w", type);
|
212
212
|
if (f == NULL) {
|
213
213
|
return "";
|
@@ -219,7 +219,7 @@ setOomScoreNeverKill() {
|
|
219
219
|
fprintf(f, "-17\n");
|
220
220
|
}
|
221
221
|
fclose(f);
|
222
|
-
|
222
|
+
|
223
223
|
return oldScore;
|
224
224
|
}
|
225
225
|
|
@@ -237,34 +237,34 @@ waitForStarterProcessOrWatchers(const WorkingObjectsPtr &wo, vector<AgentWatcher
|
|
237
237
|
fd_set fds;
|
238
238
|
int max, ret;
|
239
239
|
char x;
|
240
|
-
|
240
|
+
|
241
241
|
FD_ZERO(&fds);
|
242
242
|
FD_SET(FEEDBACK_FD, &fds);
|
243
243
|
FD_SET(wo->errorEvent.fd(), &fds);
|
244
|
-
|
244
|
+
|
245
245
|
if (FEEDBACK_FD > wo->errorEvent.fd()) {
|
246
246
|
max = FEEDBACK_FD;
|
247
247
|
} else {
|
248
248
|
max = wo->errorEvent.fd();
|
249
249
|
}
|
250
|
-
|
250
|
+
|
251
251
|
ret = syscalls::select(max + 1, &fds, NULL, NULL, NULL);
|
252
252
|
if (ret == -1) {
|
253
253
|
int e = errno;
|
254
254
|
P_ERROR("select() failed: " << strerror(e));
|
255
255
|
return false;
|
256
256
|
}
|
257
|
-
|
257
|
+
|
258
258
|
if (FD_ISSET(wo->errorEvent.fd(), &fds)) {
|
259
259
|
vector<AgentWatcherPtr>::const_iterator it;
|
260
260
|
string message, backtrace, watcherName;
|
261
|
-
|
261
|
+
|
262
262
|
for (it = watchers.begin(); it != watchers.end() && message.empty(); it++) {
|
263
263
|
message = (*it)->getErrorMessage();
|
264
264
|
backtrace = (*it)->getErrorBacktrace();
|
265
265
|
watcherName = (*it)->name();
|
266
266
|
}
|
267
|
-
|
267
|
+
|
268
268
|
if (!message.empty() && backtrace.empty()) {
|
269
269
|
P_ERROR("Error in " << watcherName << " watcher:\n " << message);
|
270
270
|
} else if (!message.empty() && !backtrace.empty()) {
|
@@ -340,11 +340,11 @@ cleanupAgentsInBackground(const WorkingObjectsPtr &wo, vector<AgentWatcherPtr> &
|
|
340
340
|
// Change process title.
|
341
341
|
strcpy(argv[0], "PassengerWatchdog (cleaning up...)");
|
342
342
|
#endif
|
343
|
-
|
343
|
+
|
344
344
|
// Wait until all agent processes have exited. The starter
|
345
345
|
// process is responsible for telling the individual agents
|
346
346
|
// to exit.
|
347
|
-
|
347
|
+
|
348
348
|
max = 0;
|
349
349
|
FD_ZERO(&fds);
|
350
350
|
for (it = watchers.begin(); it != watchers.end(); it++) {
|
@@ -361,7 +361,7 @@ cleanupAgentsInBackground(const WorkingObjectsPtr &wo, vector<AgentWatcherPtr> &
|
|
361
361
|
&& timer.elapsed() < deadline)
|
362
362
|
{
|
363
363
|
struct timeval timeout;
|
364
|
-
|
364
|
+
|
365
365
|
#ifdef FD_COPY
|
366
366
|
FD_COPY(&fds, &fds2);
|
367
367
|
#else
|
@@ -370,7 +370,7 @@ cleanupAgentsInBackground(const WorkingObjectsPtr &wo, vector<AgentWatcherPtr> &
|
|
370
370
|
FD_SET((*it)->getFeedbackFd(), &fds2);
|
371
371
|
}
|
372
372
|
#endif
|
373
|
-
|
373
|
+
|
374
374
|
timeout.tv_sec = 0;
|
375
375
|
timeout.tv_usec = 10000;
|
376
376
|
agentProcessesDone = syscalls::select(max + 1, &fds2, NULL, NULL, &timeout);
|
@@ -413,15 +413,15 @@ cleanupAgentsInBackground(const WorkingObjectsPtr &wo, vector<AgentWatcherPtr> &
|
|
413
413
|
P_CRITICAL("An unknown exception occurred during cleaning up");
|
414
414
|
_exit(1);
|
415
415
|
}
|
416
|
-
|
416
|
+
|
417
417
|
} else if (pid == -1) {
|
418
418
|
// Error
|
419
419
|
e = errno;
|
420
420
|
throw SystemException("fork() failed", e);
|
421
|
-
|
421
|
+
|
422
422
|
} else {
|
423
423
|
// Parent
|
424
|
-
|
424
|
+
|
425
425
|
// Let child process handle cleanup.
|
426
426
|
wo->serverInstanceDir->detach();
|
427
427
|
wo->generation->detach();
|
@@ -431,7 +431,7 @@ cleanupAgentsInBackground(const WorkingObjectsPtr &wo, vector<AgentWatcherPtr> &
|
|
431
431
|
static void
|
432
432
|
forceAllAgentsShutdown(const WorkingObjectsPtr &wo, vector<AgentWatcherPtr> &watchers) {
|
433
433
|
vector<AgentWatcherPtr>::iterator it;
|
434
|
-
|
434
|
+
|
435
435
|
for (it = watchers.begin(); it != watchers.end(); it++) {
|
436
436
|
(*it)->signalShutdown();
|
437
437
|
}
|
@@ -488,7 +488,7 @@ initializeBareEssentials(int argc, char *argv[]) {
|
|
488
488
|
* so we need to restore it after each fork().
|
489
489
|
*/
|
490
490
|
oldOomScore = setOomScoreNeverKill();
|
491
|
-
|
491
|
+
|
492
492
|
agentsOptions = initializeAgent(argc, argv, "PassengerWatchdog");
|
493
493
|
|
494
494
|
if (agentsOptions.get("test_binary", false) == "1") {
|
@@ -556,7 +556,7 @@ maybeSetsid() {
|
|
556
556
|
static void
|
557
557
|
lookupDefaultUidGid(uid_t &uid, gid_t &gid) {
|
558
558
|
struct passwd *userEntry;
|
559
|
-
|
559
|
+
|
560
560
|
userEntry = getpwnam(defaultUser.c_str());
|
561
561
|
if (userEntry == NULL) {
|
562
562
|
throw NonExistentUserException("Default user '" + defaultUser +
|
@@ -699,7 +699,7 @@ main(int argc, char *argv[]) {
|
|
699
699
|
WorkingObjectsPtr wo;
|
700
700
|
ServerInstanceDirToucherPtr serverInstanceDirToucher;
|
701
701
|
vector<AgentWatcherPtr> watchers;
|
702
|
-
|
702
|
+
|
703
703
|
try {
|
704
704
|
TRACE_POINT();
|
705
705
|
initializeOptions();
|
@@ -728,7 +728,7 @@ main(int argc, char *argv[]) {
|
|
728
728
|
P_INFO("All Phusion Passenger agents started!");
|
729
729
|
UPDATE_TRACE_POINT();
|
730
730
|
runHookScriptAndThrowOnError("after_watchdog_initialization");
|
731
|
-
|
731
|
+
|
732
732
|
UPDATE_TRACE_POINT();
|
733
733
|
this_thread::disable_interruption di;
|
734
734
|
this_thread::disable_syscall_interruption dsi;
|
@@ -32,14 +32,14 @@ class ServerInstanceDirToucher {
|
|
32
32
|
private:
|
33
33
|
WorkingObjectsPtr wo;
|
34
34
|
oxt::thread *thr;
|
35
|
-
|
35
|
+
|
36
36
|
void
|
37
37
|
threadMain() {
|
38
38
|
while (!this_thread::interruption_requested()) {
|
39
39
|
syscalls::sleep(60 * 60 * 6);
|
40
|
-
|
40
|
+
|
41
41
|
begin_touch:
|
42
|
-
|
42
|
+
|
43
43
|
this_thread::disable_interruption di;
|
44
44
|
this_thread::disable_syscall_interruption dsi;
|
45
45
|
// Fork a process which touches everything in the server instance dir.
|
@@ -47,9 +47,9 @@ private:
|
|
47
47
|
if (pid == 0) {
|
48
48
|
// Child
|
49
49
|
int prio, ret, e;
|
50
|
-
|
50
|
+
|
51
51
|
closeAllFileDescriptors(2);
|
52
|
-
|
52
|
+
|
53
53
|
// Make process nicer.
|
54
54
|
do {
|
55
55
|
prio = getpriority(PRIO_PROCESS, getpid());
|
@@ -65,7 +65,7 @@ private:
|
|
65
65
|
} else {
|
66
66
|
perror("getpriority");
|
67
67
|
}
|
68
|
-
|
68
|
+
|
69
69
|
do {
|
70
70
|
ret = chdir(wo->serverInstanceDir->getPath().c_str());
|
71
71
|
} while (ret == -1 && errno == EINTR);
|
@@ -77,9 +77,9 @@ private:
|
|
77
77
|
fflush(stderr);
|
78
78
|
_exit(1);
|
79
79
|
}
|
80
|
-
|
80
|
+
|
81
81
|
setOomScore(oldOomScore);
|
82
|
-
|
82
|
+
|
83
83
|
execlp("/bin/sh", "/bin/sh", "-c", "find . | xargs touch", (char *) 0);
|
84
84
|
e = errno;
|
85
85
|
fprintf(stderr, "Cannot execute 'find . | xargs touch': %s (%d)\n",
|
@@ -106,7 +106,7 @@ public:
|
|
106
106
|
thr = new oxt::thread(boost::bind(&ServerInstanceDirToucher::threadMain, this),
|
107
107
|
"Server instance dir toucher", 256 * 1024);
|
108
108
|
}
|
109
|
-
|
109
|
+
|
110
110
|
~ServerInstanceDirToucher() {
|
111
111
|
thr->interrupt_and_join();
|
112
112
|
delete thr;
|
data/ext/libeio/eio.c
CHANGED
@@ -80,7 +80,7 @@
|
|
80
80
|
static void eio_destroy (eio_req *req);
|
81
81
|
|
82
82
|
#ifndef EIO_FINISH
|
83
|
-
# define EIO_FINISH(req) ((req)->finish)
|
83
|
+
# define EIO_FINISH(req) ((req)->finish) ? (req)->finish (req) : 0
|
84
84
|
#endif
|
85
85
|
|
86
86
|
#ifndef EIO_DESTROY
|
data/ext/nginx/Configuration.c
CHANGED
@@ -61,12 +61,12 @@ void *
|
|
61
61
|
passenger_create_main_conf(ngx_conf_t *cf)
|
62
62
|
{
|
63
63
|
passenger_main_conf_t *conf;
|
64
|
-
|
64
|
+
|
65
65
|
conf = ngx_pcalloc(cf->pool, sizeof(passenger_main_conf_t));
|
66
66
|
if (conf == NULL) {
|
67
67
|
return NGX_CONF_ERROR;
|
68
68
|
}
|
69
|
-
|
69
|
+
|
70
70
|
conf->ctl = ngx_array_create(cf->pool, 1, sizeof(ngx_keyval_t));
|
71
71
|
if (conf->ctl == NULL) {
|
72
72
|
return NGX_CONF_ERROR;
|
@@ -95,12 +95,12 @@ passenger_create_main_conf(ngx_conf_t *cf)
|
|
95
95
|
conf->union_station_gateway_cert.len = 0;
|
96
96
|
conf->union_station_proxy_address.data = NULL;
|
97
97
|
conf->union_station_proxy_address.len = 0;
|
98
|
-
|
98
|
+
|
99
99
|
conf->prestart_uris = ngx_array_create(cf->pool, 1, sizeof(ngx_str_t));
|
100
100
|
if (conf->prestart_uris == NULL) {
|
101
101
|
return NGX_CONF_ERROR;
|
102
102
|
}
|
103
|
-
|
103
|
+
|
104
104
|
return conf;
|
105
105
|
}
|
106
106
|
|
@@ -111,10 +111,10 @@ passenger_init_main_conf(ngx_conf_t *cf, void *conf_pointer)
|
|
111
111
|
struct passwd *user_entry;
|
112
112
|
struct group *group_entry;
|
113
113
|
char buf[128];
|
114
|
-
|
114
|
+
|
115
115
|
conf = &passenger_main_conf;
|
116
116
|
*conf = *((passenger_main_conf_t *) conf_pointer);
|
117
|
-
|
117
|
+
|
118
118
|
if (conf->default_ruby.len == 0) {
|
119
119
|
conf->default_ruby.data = (u_char *) DEFAULT_RUBY;
|
120
120
|
conf->default_ruby.len = strlen(DEFAULT_RUBY);
|
@@ -123,27 +123,27 @@ passenger_init_main_conf(ngx_conf_t *cf, void *conf_pointer)
|
|
123
123
|
if (conf->log_level == (ngx_int_t) NGX_CONF_UNSET) {
|
124
124
|
conf->log_level = DEFAULT_LOG_LEVEL;
|
125
125
|
}
|
126
|
-
|
126
|
+
|
127
127
|
if (conf->debug_log_file.len == 0) {
|
128
128
|
conf->debug_log_file.data = (u_char *) "";
|
129
129
|
}
|
130
|
-
|
130
|
+
|
131
131
|
if (conf->abort_on_startup_error == NGX_CONF_UNSET) {
|
132
132
|
conf->abort_on_startup_error = 0;
|
133
133
|
}
|
134
|
-
|
134
|
+
|
135
135
|
if (conf->max_pool_size == (ngx_uint_t) NGX_CONF_UNSET) {
|
136
136
|
conf->max_pool_size = DEFAULT_MAX_POOL_SIZE;
|
137
137
|
}
|
138
|
-
|
138
|
+
|
139
139
|
if (conf->pool_idle_time == (ngx_uint_t) NGX_CONF_UNSET) {
|
140
140
|
conf->pool_idle_time = DEFAULT_POOL_IDLE_TIME;
|
141
141
|
}
|
142
|
-
|
142
|
+
|
143
143
|
if (conf->user_switching == NGX_CONF_UNSET) {
|
144
144
|
conf->user_switching = 1;
|
145
145
|
}
|
146
|
-
|
146
|
+
|
147
147
|
if (conf->default_user.len == 0) {
|
148
148
|
conf->default_user.len = sizeof(DEFAULT_WEB_APP_USER) - 1;
|
149
149
|
conf->default_user.data = (u_char *) DEFAULT_WEB_APP_USER;
|
@@ -157,7 +157,7 @@ passenger_init_main_conf(ngx_conf_t *cf, void *conf_pointer)
|
|
157
157
|
if (user_entry == NULL) {
|
158
158
|
return "The user specified by the 'default_user' option does not exist.";
|
159
159
|
}
|
160
|
-
|
160
|
+
|
161
161
|
if (conf->default_group.len > 0) {
|
162
162
|
if (conf->default_group.len > sizeof(buf) - 1) {
|
163
163
|
return "Value for 'default_group' is too long.";
|
@@ -169,34 +169,34 @@ passenger_init_main_conf(ngx_conf_t *cf, void *conf_pointer)
|
|
169
169
|
return "The group specified by the 'default_group' option does not exist.";
|
170
170
|
}
|
171
171
|
}
|
172
|
-
|
172
|
+
|
173
173
|
if (conf->analytics_log_user.len == 0) {
|
174
174
|
conf->analytics_log_user.len = sizeof(DEFAULT_ANALYTICS_LOG_USER) - 1;
|
175
175
|
conf->analytics_log_user.data = (u_char *) DEFAULT_ANALYTICS_LOG_USER;
|
176
176
|
}
|
177
|
-
|
177
|
+
|
178
178
|
if (conf->analytics_log_group.len == 0) {
|
179
179
|
conf->analytics_log_group.len = sizeof(DEFAULT_ANALYTICS_LOG_GROUP) - 1;
|
180
180
|
conf->analytics_log_group.data = (u_char *) DEFAULT_ANALYTICS_LOG_GROUP;
|
181
181
|
}
|
182
|
-
|
182
|
+
|
183
183
|
if (conf->union_station_gateway_address.len == 0) {
|
184
184
|
conf->union_station_gateway_address.len = sizeof(DEFAULT_UNION_STATION_GATEWAY_ADDRESS) - 1;
|
185
185
|
conf->union_station_gateway_address.data = (u_char *) DEFAULT_UNION_STATION_GATEWAY_ADDRESS;
|
186
186
|
}
|
187
|
-
|
187
|
+
|
188
188
|
if (conf->union_station_gateway_port == (ngx_uint_t) NGX_CONF_UNSET) {
|
189
189
|
conf->union_station_gateway_port = DEFAULT_UNION_STATION_GATEWAY_PORT;
|
190
190
|
}
|
191
|
-
|
191
|
+
|
192
192
|
if (conf->union_station_gateway_cert.len == 0) {
|
193
193
|
conf->union_station_gateway_cert.data = (u_char *) "";
|
194
194
|
}
|
195
|
-
|
195
|
+
|
196
196
|
if (conf->union_station_proxy_address.len == 0) {
|
197
197
|
conf->union_station_proxy_address.data = (u_char *) "";
|
198
198
|
}
|
199
|
-
|
199
|
+
|
200
200
|
return NGX_CONF_OK;
|
201
201
|
}
|
202
202
|
|
@@ -271,19 +271,19 @@ passenger_create_loc_conf(ngx_conf_t *cf)
|
|
271
271
|
|
272
272
|
conf->upstream_config.cyclic_temp_file = 0;
|
273
273
|
conf->upstream_config.change_buffering = 1;
|
274
|
-
|
274
|
+
|
275
275
|
#define DEFINE_VAR_TO_PASS(header_name, var_name) \
|
276
276
|
kv = ngx_array_push(conf->vars_source); \
|
277
277
|
kv->key.data = (u_char *) header_name; \
|
278
278
|
kv->key.len = strlen(header_name) + 1; \
|
279
279
|
kv->value.data = (u_char *) var_name; \
|
280
280
|
kv->value.len = strlen(var_name) + 1
|
281
|
-
|
281
|
+
|
282
282
|
conf->vars_source = ngx_array_create(cf->pool, 4, sizeof(ngx_keyval_t));
|
283
283
|
if (conf->vars_source == NULL) {
|
284
284
|
return NGX_CONF_ERROR;
|
285
285
|
}
|
286
|
-
|
286
|
+
|
287
287
|
DEFINE_VAR_TO_PASS("SCGI", "1");
|
288
288
|
DEFINE_VAR_TO_PASS("QUERY_STRING", "$query_string");
|
289
289
|
DEFINE_VAR_TO_PASS("REQUEST_METHOD", "$request_method");
|
@@ -329,7 +329,7 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
|
329
329
|
cache_loc_conf_options(cf, prev);
|
330
330
|
}
|
331
331
|
cache_loc_conf_options(cf, conf);
|
332
|
-
|
332
|
+
|
333
333
|
if (prev->base_uris != NGX_CONF_UNSET_PTR) {
|
334
334
|
if (conf->base_uris == NGX_CONF_UNSET_PTR) {
|
335
335
|
conf->base_uris = ngx_array_create(cf->pool, 4, sizeof(ngx_str_t));
|
@@ -337,7 +337,7 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
|
337
337
|
return NGX_CONF_ERROR;
|
338
338
|
}
|
339
339
|
}
|
340
|
-
|
340
|
+
|
341
341
|
prev_base_uris = (ngx_str_t *) prev->base_uris->elts;
|
342
342
|
for (i = 0; i < prev->base_uris->nelts; i++) {
|
343
343
|
base_uri = (ngx_str_t *) ngx_array_push(conf->base_uris);
|
@@ -347,7 +347,7 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
|
347
347
|
*base_uri = prev_base_uris[i];
|
348
348
|
}
|
349
349
|
}
|
350
|
-
|
350
|
+
|
351
351
|
if (prev->union_station_filters != NGX_CONF_UNSET_PTR) {
|
352
352
|
if (conf->union_station_filters == NGX_CONF_UNSET_PTR) {
|
353
353
|
conf->union_station_filters = ngx_array_create(cf->pool, 4, sizeof(ngx_str_t));
|
@@ -355,7 +355,7 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
|
355
355
|
return NGX_CONF_ERROR;
|
356
356
|
}
|
357
357
|
}
|
358
|
-
|
358
|
+
|
359
359
|
prev_union_station_filters = (ngx_str_t *) prev->union_station_filters->elts;
|
360
360
|
for (i = 0; i < prev->union_station_filters->nelts; i++) {
|
361
361
|
union_station_filter = (ngx_str_t *) ngx_array_push(conf->union_station_filters);
|
@@ -758,7 +758,7 @@ passenger_enabled(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|
758
758
|
value = cf->args->elts;
|
759
759
|
if (ngx_strcasecmp(value[1].data, (u_char *) "on") == 0) {
|
760
760
|
passenger_conf->enabled = 1;
|
761
|
-
|
761
|
+
|
762
762
|
/* Register a placeholder value as upstream address. The real upstream
|
763
763
|
* address (the helper agent socket filename) will be set while processing
|
764
764
|
* requests, because we can't start the helper agent until config
|
@@ -771,7 +771,7 @@ passenger_enabled(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|
771
771
|
if (passenger_conf->upstream_config.upstream == NULL) {
|
772
772
|
return NGX_CONF_ERROR;
|
773
773
|
}
|
774
|
-
|
774
|
+
|
775
775
|
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
|
776
776
|
clcf->handler = passenger_content_handler;
|
777
777
|
|
@@ -885,7 +885,7 @@ set_null_terminated_keyval_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|
885
885
|
kv->key.len = value[1].len + 1;
|
886
886
|
last = ngx_copy(kv->key.data, value[1].data, value[1].len);
|
887
887
|
*last = '\0';
|
888
|
-
|
888
|
+
|
889
889
|
kv->value.data = ngx_palloc(cf->pool, value[2].len + 1);
|
890
890
|
kv->value.len = value[2].len + 1;
|
891
891
|
last = ngx_copy(kv->value.data, value[2].data, value[2].len);
|