passenger 5.1.7 → 5.1.8
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 +4 -4
- data/CHANGELOG +13 -2
- data/CONTRIBUTING.md +1 -1
- data/build/agent.rb +1 -1
- data/build/cxx_tests.rb +6 -0
- data/build/support/cxx_dependency_map.rb +1286 -391
- data/build/support/general.rb +0 -26
- data/resources/templates/standalone/rails_asset_pipeline.erb +2 -2
- data/src/agent/Core/ApiServer.h +49 -44
- data/src/agent/Core/ApplicationPool/Pool.h +1 -1
- data/src/agent/Core/ApplicationPool/Process.h +1 -1
- data/src/agent/Core/ApplicationPool/Socket.h +1 -1
- data/src/agent/Core/Controller.h +16 -8
- data/src/agent/Core/Controller/CheckoutSession.cpp +1 -1
- data/src/agent/Core/Controller/Config.cpp +68 -0
- data/src/agent/Core/Controller/Config.h +70 -34
- data/src/agent/Core/Controller/ForwardResponse.cpp +5 -5
- data/src/agent/Core/Controller/Hooks.cpp +5 -14
- data/src/agent/Core/Controller/Implementation.cpp +1 -1
- data/src/agent/Core/Controller/InitRequest.cpp +31 -29
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +4 -4
- data/src/agent/Core/Controller/InternalUtils.cpp +3 -3
- data/src/agent/Core/Controller/Miscellaneous.cpp +1 -1
- data/src/agent/Core/Controller/Request.h +2 -2
- data/src/agent/Core/Controller/SendRequest.cpp +5 -5
- data/src/agent/Core/Controller/StateInspection.cpp +1 -1
- data/src/agent/Core/Controller/TurboCaching.h +2 -2
- data/src/agent/Core/CoreMain.cpp +2 -2
- data/src/agent/Core/ResponseCache.h +3 -3
- data/src/agent/Core/SpawningKit/BackgroundIOCapturer.h +3 -3
- data/src/agent/Core/SpawningKit/DirectSpawner.h +2 -2
- data/src/agent/Core/SpawningKit/PipeWatcher.h +3 -3
- data/src/agent/Core/SpawningKit/SmartSpawner.h +2 -2
- data/src/agent/Core/SpawningKit/Spawner.h +1 -1
- data/src/agent/Core/UnionStation/Connection.h +1 -1
- data/src/agent/Core/UnionStation/Context.h +1 -1
- data/src/agent/Core/UnionStation/Transaction.h +1 -1
- data/src/agent/Shared/ApiServerUtils.h +73 -27
- data/src/agent/Shared/Base.cpp +61 -73
- data/src/agent/UstRouter/ApiServer.h +34 -45
- data/src/agent/UstRouter/Controller.h +86 -60
- data/src/agent/UstRouter/RemoteSender.h +1 -1
- data/src/agent/UstRouter/RemoteSink.h +1 -1
- data/src/agent/Watchdog/ApiServer.h +42 -50
- data/src/agent/Watchdog/WatchdogMain.cpp +1 -1
- data/src/apache2_module/Configuration.hpp +1 -1
- data/src/apache2_module/Hooks.cpp +27 -13
- data/src/cxx_supportlib/AppTypes.h +1 -1
- data/src/cxx_supportlib/BackgroundEventLoop.cpp +1 -1
- data/src/cxx_supportlib/ConfigKit/AsyncUtils.h +86 -0
- data/src/cxx_supportlib/ConfigKit/Common.h +6 -3
- data/src/cxx_supportlib/ConfigKit/IN_PRACTICE.md +1039 -0
- data/src/cxx_supportlib/ConfigKit/README.md +112 -497
- data/src/cxx_supportlib/ConfigKit/Schema.h +78 -15
- data/src/cxx_supportlib/ConfigKit/Store.h +272 -53
- data/src/cxx_supportlib/ConfigKit/SubComponentUtils.h +59 -0
- data/src/cxx_supportlib/ConfigKit/Utils.h +26 -65
- data/src/cxx_supportlib/ConfigKit/ValidationUtils.h +69 -0
- data/src/cxx_supportlib/ConfigKit/VariantMapUtils.h +7 -4
- data/src/cxx_supportlib/Constants.h +4 -1
- data/src/cxx_supportlib/Crypto.cpp +1 -1
- data/src/cxx_supportlib/DataStructures/StringKeyTable.h +26 -7
- data/src/cxx_supportlib/FileDescriptor.h +1 -1
- data/src/cxx_supportlib/Hooks.h +1 -1
- data/src/cxx_supportlib/LoggingKit/Assert.h +130 -0
- data/src/cxx_supportlib/LoggingKit/Config.h +97 -0
- data/src/cxx_supportlib/LoggingKit/Context.h +94 -0
- data/src/cxx_supportlib/LoggingKit/Forward.h +95 -0
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +695 -0
- data/src/cxx_supportlib/LoggingKit/Logging.h +204 -0
- data/src/cxx_supportlib/LoggingKit/LoggingKit.h +33 -0
- data/src/cxx_supportlib/LveLoggingDecorator.h +1 -1
- data/src/cxx_supportlib/MemoryKit/mbuf.cpp +1 -1
- data/src/cxx_supportlib/RandomGenerator.h +1 -1
- data/src/cxx_supportlib/SafeLibev.h +1 -1
- data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +1 -1
- data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
- data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/FileBufferedFdSinkChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParser.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpServer.h +48 -15
- data/src/cxx_supportlib/ServerKit/Server.h +79 -52
- data/src/cxx_supportlib/StaticString.h +12 -0
- data/src/cxx_supportlib/Utils/Curl.h +16 -0
- data/src/cxx_supportlib/Utils/FastStringStream.h +6 -1
- data/src/cxx_supportlib/Utils/ScopeGuard.h +1 -1
- data/src/cxx_supportlib/Utils/StrIntUtils.cpp +2 -19
- data/src/cxx_supportlib/WatchdogLauncher.h +3 -2
- data/src/ruby_supportlib/phusion_passenger.rb +3 -3
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +12 -12
- data/src/ruby_supportlib/phusion_passenger/constants.rb +6 -3
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/stop_command.rb +1 -0
- metadata +14 -4
- data/src/cxx_supportlib/Logging.cpp +0 -295
- data/src/cxx_supportlib/Logging.h +0 -385
@@ -808,7 +808,7 @@ Controller::sendResponseHeaderWithWritev(Client *client, Request *req,
|
|
808
808
|
{
|
809
809
|
TRACE_POINT();
|
810
810
|
|
811
|
-
if (OXT_UNLIKELY(
|
811
|
+
if (OXT_UNLIKELY(mainConfig.benchmarkMode == BM_RESPONSE_BEGIN)) {
|
812
812
|
writeBenchmarkResponse(&client, &req, false);
|
813
813
|
return true;
|
814
814
|
}
|
@@ -887,7 +887,7 @@ void
|
|
887
887
|
Controller::logResponseHeaders(Client *client, Request *req, struct iovec *buffers,
|
888
888
|
unsigned int nbuffers, unsigned int dataSize)
|
889
889
|
{
|
890
|
-
if (OXT_UNLIKELY(
|
890
|
+
if (OXT_UNLIKELY(LoggingKit::getLevel() >= LoggingKit::DEBUG3)) {
|
891
891
|
TRACE_POINT();
|
892
892
|
char *buffer = (char *) psg_pnalloc(req->pool, dataSize);
|
893
893
|
gatherBuffers(buffer, dataSize, buffers, nbuffers);
|
@@ -983,7 +983,7 @@ void
|
|
983
983
|
Controller::writeResponseAndMarkForTurboCaching(Client *client, Request *req,
|
984
984
|
const MemoryKit::mbuf &buffer)
|
985
985
|
{
|
986
|
-
if (OXT_LIKELY(
|
986
|
+
if (OXT_LIKELY(mainConfig.benchmarkMode != BM_RESPONSE_BEGIN)) {
|
987
987
|
writeResponse(client, buffer);
|
988
988
|
}
|
989
989
|
markResponsePartForTurboCaching(client, req, buffer);
|
@@ -1015,8 +1015,8 @@ Controller::maybeThrottleAppSource(Client *client, Request *req) {
|
|
1015
1015
|
if (!req->ended()) {
|
1016
1016
|
assert(client->output.getBuffersFlushedCallback() == NULL);
|
1017
1017
|
assert(client->output.getDataFlushedCallback() == getClientOutputDataFlushedCallback());
|
1018
|
-
if (
|
1019
|
-
&& client->output.getTotalBytesBuffered() >=
|
1018
|
+
if (mainConfig.responseBufferHighWatermark > 0
|
1019
|
+
&& client->output.getTotalBytesBuffered() >= mainConfig.responseBufferHighWatermark)
|
1020
1020
|
{
|
1021
1021
|
SKC_TRACE(client, 2, "Application is sending response data quicker than the client "
|
1022
1022
|
"can keep up with. Throttling application socket");
|
@@ -135,7 +135,7 @@ Controller::reinitializeRequest(Client *client, Request *req) {
|
|
135
135
|
req->strip100ContinueHeader = false;
|
136
136
|
req->hasPragmaHeader = false;
|
137
137
|
req->host = NULL;
|
138
|
-
req->
|
138
|
+
req->config = requestConfig;
|
139
139
|
req->bodyBytesBuffered = 0;
|
140
140
|
req->cacheKey = HashedStaticString();
|
141
141
|
req->cacheControl = NULL;
|
@@ -155,7 +155,7 @@ Controller::reinitializeRequest(Client *client, Request *req) {
|
|
155
155
|
void
|
156
156
|
Controller::deinitializeRequest(Client *client, Request *req) {
|
157
157
|
req->session.reset();
|
158
|
-
req->
|
158
|
+
req->config.reset();
|
159
159
|
|
160
160
|
req->endStopwatchLog(&req->stopwatchLogs.getFromPool, false);
|
161
161
|
req->endStopwatchLog(&req->stopwatchLogs.bufferingRequestBody, false);
|
@@ -277,7 +277,7 @@ Controller::onNextRequestEarlyReadError(Client *client, Request *req, int errcod
|
|
277
277
|
bool
|
278
278
|
Controller::shouldDisconnectClientOnShutdown(Client *client) {
|
279
279
|
return ParentClass::shouldDisconnectClientOnShutdown(client)
|
280
|
-
|| !
|
280
|
+
|| !mainConfig.gracefulExit;
|
281
281
|
}
|
282
282
|
|
283
283
|
bool
|
@@ -285,15 +285,6 @@ Controller::supportsUpgrade(Client *client, Request *req) {
|
|
285
285
|
return true;
|
286
286
|
}
|
287
287
|
|
288
|
-
void
|
289
|
-
Controller::onConfigChange(const ConfigKit::Store *oldConfig) {
|
290
|
-
ParentClass::onConfigChange(oldConfig);
|
291
|
-
mainConfigCache.update(config);
|
292
|
-
requestConfigCache.reset(new ControllerRequestConfigCache(config));
|
293
|
-
getContext()->defaultFileBufferedChannelConfig.bufferDir =
|
294
|
-
config["data_buffer_dir"].asString();
|
295
|
-
}
|
296
|
-
|
297
288
|
|
298
289
|
/****************************
|
299
290
|
*
|
@@ -308,7 +299,7 @@ Controller::getClientName(const Client *client, char *buf, size_t size) const {
|
|
308
299
|
const char *end = buf + size - 1;
|
309
300
|
// WARNING: If you change the format, be sure to change
|
310
301
|
// ApiServer::extractThreadNumberFromClientName() too.
|
311
|
-
pos += uintToString(
|
302
|
+
pos += uintToString(mainConfig.threadNumber, pos, end - pos);
|
312
303
|
pos = appendData(pos, end, "-", 1);
|
313
304
|
pos += uintToString(client->number, pos, end - pos);
|
314
305
|
*pos = '\0';
|
@@ -317,7 +308,7 @@ Controller::getClientName(const Client *client, char *buf, size_t size) const {
|
|
317
308
|
|
318
309
|
StaticString
|
319
310
|
Controller::getServerName() const {
|
320
|
-
return
|
311
|
+
return mainConfig.serverLogName;
|
321
312
|
}
|
322
313
|
|
323
314
|
|
@@ -82,7 +82,7 @@ Controller::initializeFlags(Client *client, Request *req, RequestAnalysis &analy
|
|
82
82
|
part = part->next;
|
83
83
|
}
|
84
84
|
|
85
|
-
if (OXT_UNLIKELY(
|
85
|
+
if (OXT_UNLIKELY(LoggingKit::getLevel() >= LoggingKit::DEBUG2)) {
|
86
86
|
if (req->dechunkResponse) {
|
87
87
|
SKC_TRACE(client, 2, "Dechunk flag detected");
|
88
88
|
}
|
@@ -136,7 +136,7 @@ void
|
|
136
136
|
Controller::initializePoolOptions(Client *client, Request *req, RequestAnalysis &analysis) {
|
137
137
|
boost::shared_ptr<Options> *options;
|
138
138
|
|
139
|
-
if (req->
|
139
|
+
if (req->config->singleAppMode) {
|
140
140
|
P_ASSERT_EQ(poolOptionsCache.size(), 1);
|
141
141
|
poolOptionsCache.lookupRandom(NULL, &options);
|
142
142
|
req->options = **options;
|
@@ -172,36 +172,38 @@ Controller::initializePoolOptions(Client *client, Request *req, RequestAnalysis
|
|
172
172
|
req->envvars->size);
|
173
173
|
}
|
174
174
|
|
175
|
+
// Allow certain options to be overriden on a per-request basis
|
175
176
|
fillPoolOption(req, req->options.maxRequests, PASSENGER_MAX_REQUESTS);
|
176
177
|
}
|
177
178
|
}
|
178
179
|
|
179
180
|
void
|
180
181
|
Controller::fillPoolOptionsFromConfigCaches(Options &options,
|
181
|
-
const
|
182
|
+
psg_pool_t *pool, const ControllerRequestConfigPtr &requestConfig)
|
182
183
|
{
|
183
|
-
options.ruby =
|
184
|
-
options.nodejs =
|
185
|
-
options.python =
|
186
|
-
options.meteorAppSettings =
|
187
|
-
options.fileDescriptorUlimit =
|
188
|
-
|
189
|
-
options.logLevel =
|
190
|
-
options.integrationMode =
|
191
|
-
options.ustRouterAddress =
|
184
|
+
options.ruby = requestConfig->defaultRuby;
|
185
|
+
options.nodejs = requestConfig->defaultNodejs;
|
186
|
+
options.python = requestConfig->defaultPython;
|
187
|
+
options.meteorAppSettings = requestConfig->meteorAppSettings;
|
188
|
+
options.fileDescriptorUlimit = requestConfig->fileDescriptorUlimit;
|
189
|
+
|
190
|
+
options.logLevel = int(LoggingKit::getLevel());
|
191
|
+
options.integrationMode = psg_pstrdup(pool, mainConfig.integrationMode);
|
192
|
+
options.ustRouterAddress = requestConfig->ustRouterAddress;
|
192
193
|
options.ustRouterUsername = P_STATIC_STRING("logging");
|
193
|
-
options.ustRouterPassword =
|
194
|
-
options.userSwitching =
|
195
|
-
options.defaultUser =
|
196
|
-
options.defaultGroup =
|
197
|
-
options.minProcesses =
|
198
|
-
options.maxPreloaderIdleTime =
|
199
|
-
options.maxRequestQueueSize =
|
200
|
-
options.abortWebsocketsOnProcessShutdown =
|
201
|
-
options.forceMaxConcurrentRequestsPerProcess =
|
202
|
-
options.spawnMethod =
|
203
|
-
options.loadShellEnvvars =
|
204
|
-
options.statThrottleRate =
|
194
|
+
options.ustRouterPassword = requestConfig->ustRouterPassword;
|
195
|
+
options.userSwitching = mainConfig.userSwitching;
|
196
|
+
options.defaultUser = requestConfig->defaultUser;
|
197
|
+
options.defaultGroup = requestConfig->defaultGroup;
|
198
|
+
options.minProcesses = requestConfig->minInstances;
|
199
|
+
options.maxPreloaderIdleTime = requestConfig->maxPreloaderIdleTime;
|
200
|
+
options.maxRequestQueueSize = requestConfig->maxRequestQueueSize;
|
201
|
+
options.abortWebsocketsOnProcessShutdown = requestConfig->abortWebsocketsOnProcessShutdown;
|
202
|
+
options.forceMaxConcurrentRequestsPerProcess = requestConfig->forceMaxConcurrentRequestsPerProcess;
|
203
|
+
options.spawnMethod = requestConfig->spawnMethod;
|
204
|
+
options.loadShellEnvvars = requestConfig->loadShellEnvvars;
|
205
|
+
options.statThrottleRate = mainConfig.statThrottleRate;
|
206
|
+
options.maxRequests = requestConfig->maxRequests;
|
205
207
|
|
206
208
|
/******************************/
|
207
209
|
}
|
@@ -333,7 +335,7 @@ Controller::createNewPoolOptions(Client *client, Request *req,
|
|
333
335
|
options.baseURI = StaticString(scriptName->start->data, scriptName->size);
|
334
336
|
}
|
335
337
|
|
336
|
-
fillPoolOptionsFromConfigCaches(options, req->
|
338
|
+
fillPoolOptionsFromConfigCaches(options, req->pool, req->config);
|
337
339
|
|
338
340
|
const LString *appType = secureHeaders.lookup("!~PASSENGER_APP_TYPE");
|
339
341
|
if (appType == NULL || appType->size == 0) {
|
@@ -446,7 +448,7 @@ Controller::getStickySessionCookieName(Request *req) {
|
|
446
448
|
const LString *value = req->headers.lookup(PASSENGER_STICKY_SESSIONS_COOKIE_NAME);
|
447
449
|
if (value == NULL || value->size == 0) {
|
448
450
|
return psg_lstr_create(req->pool,
|
449
|
-
req->
|
451
|
+
req->config->defaultStickySessionsCookieName);
|
450
452
|
} else {
|
451
453
|
return value;
|
452
454
|
}
|
@@ -471,15 +473,15 @@ Controller::onRequestBegin(Client *client, Request *req) {
|
|
471
473
|
// and localize them as much as possible, for better CPU caching.
|
472
474
|
RequestAnalysis analysis;
|
473
475
|
analysis.flags = req->secureHeaders.lookup(FLAGS);
|
474
|
-
analysis.appGroupNameCell = req->
|
476
|
+
analysis.appGroupNameCell = req->config->singleAppMode
|
475
477
|
? NULL
|
476
478
|
: req->secureHeaders.lookupCell(PASSENGER_APP_GROUP_NAME);
|
477
479
|
analysis.unionStationSupport = unionStationContext != NULL
|
478
480
|
&& getBoolOption(req, UNION_STATION_SUPPORT, false);
|
479
481
|
req->stickySession = getBoolOption(req, PASSENGER_STICKY_SESSIONS,
|
480
|
-
|
482
|
+
mainConfig.stickySessions);
|
481
483
|
req->showVersionInHeader = getBoolOption(req, PASSENGER_SHOW_VERSION_IN_HEADER,
|
482
|
-
req->
|
484
|
+
req->config->showVersionInHeader);
|
483
485
|
req->host = req->headers.lookup(HTTP_HOST);
|
484
486
|
|
485
487
|
/***************/
|
@@ -49,8 +49,8 @@ Controller::Controller(ServerKit::Context *context, const ControllerSchema &sche
|
|
49
49
|
const Json::Value &initialConfig)
|
50
50
|
: ParentClass(context, schema, initialConfig),
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
mainConfig(config),
|
53
|
+
requestConfig(new ControllerRequestConfig(config)),
|
54
54
|
poolOptionsCache(4),
|
55
55
|
|
56
56
|
PASSENGER_APP_GROUP_NAME("!~PASSENGER_APP_GROUP_NAME"),
|
@@ -115,9 +115,9 @@ Controller::initialize() {
|
|
115
115
|
getContext()->defaultFileBufferedChannelConfig.bufferDir =
|
116
116
|
config["data_buffer_dir"].asString();
|
117
117
|
|
118
|
-
if (
|
118
|
+
if (requestConfig->singleAppMode) {
|
119
119
|
boost::shared_ptr<Options> options = boost::make_shared<Options>();
|
120
|
-
fillPoolOptionsFromConfigCaches(*options,
|
120
|
+
fillPoolOptionsFromConfigCaches(*options, mainConfig.pool, requestConfig);
|
121
121
|
|
122
122
|
string appRoot = config["app_root"].asString();
|
123
123
|
string environment = config["environment"].asString();
|
@@ -48,14 +48,14 @@ using namespace boost;
|
|
48
48
|
void
|
49
49
|
Controller::disconnectWithClientSocketWriteError(Client **client, int e) {
|
50
50
|
stringstream message;
|
51
|
-
|
51
|
+
LoggingKit::Level logLevel;
|
52
52
|
message << "client socket write error: ";
|
53
53
|
message << ServerKit::getErrorDesc(e);
|
54
54
|
message << " (errno=" << e << ")";
|
55
55
|
if (e == EPIPE || e == ECONNRESET) {
|
56
|
-
logLevel =
|
56
|
+
logLevel = LoggingKit::INFO;
|
57
57
|
} else {
|
58
|
-
logLevel =
|
58
|
+
logLevel = LoggingKit::WARN;
|
59
59
|
}
|
60
60
|
disconnectWithError(client, message.str(), logLevel);
|
61
61
|
}
|
@@ -63,7 +63,7 @@ Controller::disconnectLongRunningConnections(const StaticString &gupid) {
|
|
63
63
|
&& req->session != NULL
|
64
64
|
&& req->session->getGupid() == gupid)
|
65
65
|
{
|
66
|
-
if (
|
66
|
+
if (LoggingKit::getLevel() >= LoggingKit::INFO) {
|
67
67
|
char clientName[32];
|
68
68
|
unsigned int size;
|
69
69
|
const LString *host;
|
@@ -33,7 +33,7 @@
|
|
33
33
|
#include <ServerKit/HttpRequest.h>
|
34
34
|
#include <ServerKit/FdSinkChannel.h>
|
35
35
|
#include <ServerKit/FdSourceChannel.h>
|
36
|
-
#include <
|
36
|
+
#include <LoggingKit/LoggingKit.h>
|
37
37
|
#include <Core/ApplicationPool/Pool.h>
|
38
38
|
#include <Core/UnionStation/Context.h>
|
39
39
|
#include <Core/UnionStation/Transaction.h>
|
@@ -86,7 +86,7 @@ public:
|
|
86
86
|
Options options;
|
87
87
|
AbstractSessionPtr session;
|
88
88
|
const LString *host;
|
89
|
-
|
89
|
+
ControllerRequestConfigPtr config;
|
90
90
|
|
91
91
|
ServerKit::FdSinkChannel appSink;
|
92
92
|
ServerKit::FdSourceChannel appSource;
|
@@ -393,8 +393,8 @@ Controller::determineHeaderSizeForSessionProtocol(Request *req,
|
|
393
393
|
}
|
394
394
|
}
|
395
395
|
} else {
|
396
|
-
state.serverName = req->
|
397
|
-
state.serverPort = req->
|
396
|
+
state.serverName = req->config->defaultServerName;
|
397
|
+
state.serverPort = req->config->defaultServerPort;
|
398
398
|
}
|
399
399
|
|
400
400
|
dataSize += sizeof("SERVER_NAME");
|
@@ -404,7 +404,7 @@ Controller::determineHeaderSizeForSessionProtocol(Request *req,
|
|
404
404
|
dataSize += state.serverPort.size() + 1;
|
405
405
|
|
406
406
|
dataSize += sizeof("SERVER_SOFTWARE");
|
407
|
-
dataSize += req->
|
407
|
+
dataSize += req->config->serverSoftware.size() + 1;
|
408
408
|
|
409
409
|
dataSize += sizeof("SERVER_PROTOCOL");
|
410
410
|
dataSize += sizeof("HTTP/1.1");
|
@@ -515,7 +515,7 @@ Controller::constructHeaderForSessionProtocol(Request *req, char * restrict buff
|
|
515
515
|
pos = appendData(pos, end, "", 1);
|
516
516
|
|
517
517
|
pos = appendData(pos, end, P_STATIC_STRING_WITH_NULL("SERVER_SOFTWARE"));
|
518
|
-
pos = appendData(pos, end, req->
|
518
|
+
pos = appendData(pos, end, req->config->serverSoftware);
|
519
519
|
pos = appendData(pos, end, "", 1);
|
520
520
|
|
521
521
|
pos = appendData(pos, end, P_STATIC_STRING_WITH_NULL("SERVER_PROTOCOL"));
|
@@ -635,7 +635,7 @@ Controller::sendHeaderToAppWithHttpProtocol(Client *client, Request *req) {
|
|
635
635
|
|
636
636
|
cache.cached = false;
|
637
637
|
|
638
|
-
if (OXT_UNLIKELY(
|
638
|
+
if (OXT_UNLIKELY(LoggingKit::getLevel() >= LoggingKit::DEBUG3)) {
|
639
639
|
struct iovec *buffers;
|
640
640
|
unsigned int nbuffers, dataSize;
|
641
641
|
bool ok;
|
@@ -34,7 +34,7 @@
|
|
34
34
|
#include <MemoryKit/mbuf.h>
|
35
35
|
#include <ServerKit/Context.h>
|
36
36
|
#include <Constants.h>
|
37
|
-
#include <
|
37
|
+
#include <LoggingKit/LoggingKit.h>
|
38
38
|
#include <Utils/StrIntUtils.h>
|
39
39
|
#include <Core/ResponseCache.h>
|
40
40
|
|
@@ -113,7 +113,7 @@ private:
|
|
113
113
|
|
114
114
|
prep.ageValueSize = integerSizeInOtherBase<time_t, 10>(prep.age);
|
115
115
|
prep.contentLengthStrSize = uintSizeAsString(entry.body->httpBodySize);
|
116
|
-
prep.showVersionInHeader = req->
|
116
|
+
prep.showVersionInHeader = req->config->showVersionInHeader;
|
117
117
|
}
|
118
118
|
|
119
119
|
template<typename Server>
|
data/src/agent/Core/CoreMain.cpp
CHANGED
@@ -678,6 +678,8 @@ initializeNonPrivilegedWorkingObjects() {
|
|
678
678
|
Json::Value config = ConfigKit::variantMapToJson(wo->controllerSchema,
|
679
679
|
*agentsOptions);
|
680
680
|
config["thread_number"] = i + 1;
|
681
|
+
config["min_spare_clients"] = 128;
|
682
|
+
config["client_freelist_limit"] = 1024;
|
681
683
|
|
682
684
|
if (i == 0) {
|
683
685
|
two.bgloop = firstLoop = new BackgroundEventLoop(true, true);
|
@@ -697,8 +699,6 @@ initializeNonPrivilegedWorkingObjects() {
|
|
697
699
|
UPDATE_TRACE_POINT();
|
698
700
|
two.controller = new Core::Controller(two.serverKitContext,
|
699
701
|
wo->controllerSchema, config);
|
700
|
-
two.controller->minSpareClients = 128;
|
701
|
-
two.controller->clientFreelistLimit = 1024;
|
702
702
|
two.controller->resourceLocator = &wo->resourceLocator;
|
703
703
|
two.controller->appPool = wo->appPool;
|
704
704
|
two.controller->unionStationContext = wo->unionStationContext;
|
@@ -492,12 +492,12 @@ public:
|
|
492
492
|
}
|
493
493
|
|
494
494
|
LString *varyCookieName = req->secureHeaders.lookup(PASSENGER_VARY_TURBOCACHE_BY_COOKIE);
|
495
|
-
if (varyCookieName == NULL && !req->
|
495
|
+
if (varyCookieName == NULL && !req->config->defaultVaryTurbocacheByCookie.empty()) {
|
496
496
|
varyCookieName = (LString *) psg_palloc(req->pool, sizeof(LString));
|
497
497
|
psg_lstr_init(varyCookieName);
|
498
498
|
psg_lstr_append(varyCookieName, req->pool,
|
499
|
-
req->
|
500
|
-
req->
|
499
|
+
req->config->defaultVaryTurbocacheByCookie.data(),
|
500
|
+
req->config->defaultVaryTurbocacheByCookie.size());
|
501
501
|
}
|
502
502
|
if (varyCookieName != NULL) {
|
503
503
|
LString *cookieHeader = req->headers.lookup(COOKIE);
|
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
#include <sys/types.h>
|
39
39
|
|
40
|
-
#include <
|
40
|
+
#include <LoggingKit/LoggingKit.h>
|
41
41
|
#include <FileDescriptor.h>
|
42
42
|
#include <StaticString.h>
|
43
43
|
#include <Utils.h>
|
@@ -89,7 +89,7 @@ private:
|
|
89
89
|
}
|
90
90
|
UPDATE_TRACE_POINT();
|
91
91
|
if (ret == 1 && buf[0] == '\n') {
|
92
|
-
|
92
|
+
LoggingKit::logAppOutput(pid, channelName, "", 0);
|
93
93
|
} else {
|
94
94
|
vector<StaticString> lines;
|
95
95
|
if (ret > 0 && buf[ret - 1] == '\n') {
|
@@ -97,7 +97,7 @@ private:
|
|
97
97
|
}
|
98
98
|
split(StaticString(buf, ret), '\n', lines);
|
99
99
|
foreach (const StaticString line, lines) {
|
100
|
-
|
100
|
+
LoggingKit::logAppOutput(pid, channelName, line.data(), line.size());
|
101
101
|
}
|
102
102
|
}
|
103
103
|
}
|
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
#include <Core/SpawningKit/Spawner.h>
|
30
30
|
#include <Constants.h>
|
31
|
-
#include <
|
31
|
+
#include <LoggingKit/LoggingKit.h>
|
32
32
|
#include <LveLoggingDecorator.h>
|
33
33
|
#include <limits.h> // for PTHREAD_STACK_MIN
|
34
34
|
#include <pthread.h>
|
@@ -127,7 +127,7 @@ private:
|
|
127
127
|
if (shouldLoadShellEnvvars(options, preparation)) {
|
128
128
|
command.push_back(preparation.userSwitching.shell);
|
129
129
|
command.push_back(preparation.userSwitching.shell);
|
130
|
-
if (
|
130
|
+
if (LoggingKit::getLevel() >= LoggingKit::DEBUG3) {
|
131
131
|
command.push_back("-lxc");
|
132
132
|
} else {
|
133
133
|
command.push_back("-lc");
|
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
#include <FileDescriptor.h>
|
42
42
|
#include <Constants.h>
|
43
|
-
#include <
|
43
|
+
#include <LoggingKit/LoggingKit.h>
|
44
44
|
#include <Utils.h>
|
45
45
|
#include <Utils/StrIntUtils.h>
|
46
46
|
#include <Core/SpawningKit/Config.h>
|
@@ -97,7 +97,7 @@ private:
|
|
97
97
|
}
|
98
98
|
} else if (ret == 1 && buf[0] == '\n') {
|
99
99
|
UPDATE_TRACE_POINT();
|
100
|
-
|
100
|
+
LoggingKit::logAppOutput(pid, name, "", 0);
|
101
101
|
} else {
|
102
102
|
UPDATE_TRACE_POINT();
|
103
103
|
vector<StaticString> lines;
|
@@ -107,7 +107,7 @@ private:
|
|
107
107
|
}
|
108
108
|
split(StaticString(buf, ret2), '\n', lines);
|
109
109
|
foreach (const StaticString line, lines) {
|
110
|
-
|
110
|
+
LoggingKit::logAppOutput(pid, name, line.data(), line.size());
|
111
111
|
}
|
112
112
|
}
|
113
113
|
|