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),
_size(1),
_poolSize(1),
_minElectionTimeout(0.5),
_maxElectionTimeout(2.5),
_minElectionTimeout( 2.0),
_maxElectionTimeout(10.0),
_supervision(false),
_waitForSync(true),
_supervisionFrequency(5.0),

View File

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

View File

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

View File

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

View File

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

View File

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