1
0
Fork 0

Merge branch 'devel' of ssh://github.com/ArangoDB/ArangoDB into devel

This commit is contained in:
Max Neunhoeffer 2016-09-09 16:50:18 +02:00
commit 9539f2fec6
6 changed files with 16 additions and 10 deletions

View File

@ -40,8 +40,8 @@ AgencyFeature::AgencyFeature(application_features::ApplicationServer* server)
_activated(false), _activated(false),
_size(1), _size(1),
_poolSize(1), _poolSize(1),
_minElectionTimeout(0.5), _minElectionTimeout( 2.0),
_maxElectionTimeout(2.5), _maxElectionTimeout(10.0),
_supervision(false), _supervision(false),
_waitForSync(true), _waitForSync(true),
_supervisionFrequency(5.0), _supervisionFrequency(5.0),

View File

@ -563,7 +563,7 @@ void Agent::run() {
// Leader working only // Leader working only
if (leading()) { if (leading()) {
_appendCV.wait(10000); _appendCV.wait(1000);
// Append entries to followers // Append entries to followers
sendAppendEntriesRPC(); sendAppendEntriesRPC();

View File

@ -417,7 +417,7 @@ void Constituent::run() {
std::vector<std::string> act = _agent->config().active(); std::vector<std::string> act = _agent->config().active();
while (!this->isStopping() && find(act.begin(), act.end(), _id) == act.end()) { while (!this->isStopping() && find(act.begin(), act.end(), _id) == act.end()) {
CONDITION_LOCKER(guardv, _cv); CONDITION_LOCKER(guardv, _cv);
_cv.wait(500000); _cv.wait(50000);
act = _agent->config().active(); act = _agent->config().active();
} }

View File

@ -53,7 +53,11 @@ VppCommTask::VppCommTask(GeneralServer* server, TRI_socket_t sock,
ConnectionInfo&& info, double timeout) ConnectionInfo&& info, double timeout)
: Task("VppCommTask"), : Task("VppCommTask"),
GeneralCommTask(server, sock, std::move(info), timeout), GeneralCommTask(server, sock, std::move(info), timeout),
_authenticatedUser() { _authenticatedUser(),
_authenticationEnabled(
application_features::ApplicationServer::getFeature<
GeneralServerFeature>("GeneralServer")
->authenticationEnabled()) {
_protocol = "vpp"; _protocol = "vpp";
_readBuffer.reserve( _readBuffer.reserve(
_bufferLength); // ATTENTION <- this is required so we do not _bufferLength); // ATTENTION <- this is required so we do not
@ -243,7 +247,7 @@ bool VppCommTask::processRead() {
AuthResult result = GeneralServerFeature::AUTH_INFO.checkAuthentication( AuthResult result = GeneralServerFeature::AUTH_INFO.checkAuthentication(
AuthInfo::AuthType::BASIC, auth); AuthInfo::AuthType::BASIC, auth);
if (result._authorized) { if (!_authenticationEnabled || result._authorized) {
_authenticatedUser = std::move(user); _authenticatedUser = std::move(user);
handleSimpleError(rest::ResponseCode::OK, TRI_ERROR_NO_ERROR, handleSimpleError(rest::ResponseCode::OK, TRI_ERROR_NO_ERROR,
"authentication successful", chunkHeader._messageID); "authentication successful", chunkHeader._messageID);
@ -262,8 +266,9 @@ bool VppCommTask::processRead() {
// check authentication // check authentication
std::string const& dbname = request->databaseName(); std::string const& dbname = request->databaseName();
AuthLevel level = AuthLevel::NONE; AuthLevel level = AuthLevel::RW;
if (!_authenticatedUser.empty() || !dbname.empty()) { if (_authenticationEnabled &&
(!_authenticatedUser.empty() || !dbname.empty())) {
level = GeneralServerFeature::AUTH_INFO.canUseDatabase( level = GeneralServerFeature::AUTH_INFO.canUseDatabase(
_authenticatedUser, dbname); _authenticatedUser, dbname);
} }

View File

@ -132,6 +132,7 @@ class VppCommTask : public GeneralCommTask {
char const* vpackBegin, char const* chunkEnd); char const* vpackBegin, char const* chunkEnd);
std::string _authenticatedUser; std::string _authenticatedUser;
bool _authenticationEnabled;
// user // user
// authenticated or not // authenticated or not

View File

@ -46,8 +46,8 @@ fi
SECONDARIES="$5" SECONDARIES="$5"
MINP=0.5 MINP=1.0
MAXP=2.5 MAXP=5.0
SFRE=5.0 SFRE=5.0
COMP=1000 COMP=1000
BASE=4001 BASE=4001