From 20b2221fe8e2c8caba66cf0135f7b80add3d5d89 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Tue, 17 Jan 2017 21:38:17 +0100 Subject: [PATCH 1/3] updated vpack library --- .../velocypack/include/velocypack/Buffer.h | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/3rdParty/velocypack/include/velocypack/Buffer.h b/3rdParty/velocypack/include/velocypack/Buffer.h index 675aa83991..14ed4081c3 100644 --- a/3rdParty/velocypack/include/velocypack/Buffer.h +++ b/3rdParty/velocypack/include/velocypack/Buffer.h @@ -31,6 +31,7 @@ #include #include "velocypack/velocypack-common.h" +#include "velocypack/Exception.h" namespace arangodb { namespace velocypack { @@ -154,6 +155,28 @@ class Buffer { initWithNone(); } } + + inline T& operator[](size_t position) noexcept { + return _buffer[position]; + } + + inline T const& operator[](size_t position) const noexcept { + return _buffer[position]; + } + + inline T& at(size_t position) { + if (position >= _pos) { + throw Exception(Exception::IndexOutOfBounds); + } + return operator[](position); + } + + inline T const& at(size_t position) const { + if (position >= _pos) { + throw Exception(Exception::IndexOutOfBounds); + } + return operator[](position); + } inline void push_back(char c) { reserve(1); @@ -171,6 +194,14 @@ class Buffer { memcpy(_buffer + _pos, p, checkOverflow(len)); _pos += len; } + + void append(std::string const& value) { + return append(value.c_str(), value.size()); + } + + void append(Buffer const& value) { + return append(value.data(), value.size()); + } void reserve(ValueLength len) { if (_pos + len < _alloc) { From 769a44c95acd2ae8dea38bd274164321a8ae0ce5 Mon Sep 17 00:00:00 2001 From: Kaveh Vahedipour Date: Tue, 17 Jan 2017 23:32:38 +0100 Subject: [PATCH 2/3] ttl timeouts need to be extended. oh my\! --- js/client/tests/agency/agency-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/client/tests/agency/agency-test.js b/js/client/tests/agency/agency-test.js index fe624c4a97..360165927e 100644 --- a/js/client/tests/agency/agency-test.js +++ b/js/client/tests/agency/agency-test.js @@ -359,12 +359,12 @@ function agencyTestSuite () { assertEqual(readAndCheck([["a/z"]]), [{"a":{"z":12}}]); writeAndCheck([[{"a/y":{"op":"set","new":12, "ttl": 1}}]]); assertEqual(readAndCheck([["a/y"]]), [{"a":{"y":12}}]); - wait(2.0); + wait(3.0); assertEqual(readAndCheck([["a/y"]]), [{a:{}}]); writeAndCheck([[{"a/y":{"op":"set","new":12, "ttl": 1}}]]); writeAndCheck([[{"a/y":{"op":"set","new":12}}]]); assertEqual(readAndCheck([["a/y"]]), [{"a":{"y":12}}]); - wait(2.0); + wait(3.0); assertEqual(readAndCheck([["a/y"]]), [{"a":{"y":12}}]); writeAndCheck([[{"foo/bar":{"op":"set","new":{"baz":12}}}]]); assertEqual(readAndCheck([["/foo/bar/baz"]]), @@ -372,7 +372,7 @@ function agencyTestSuite () { assertEqual(readAndCheck([["/foo/bar"]]), [{"foo":{"bar":{"baz":12}}}]); assertEqual(readAndCheck([["/foo"]]), [{"foo":{"bar":{"baz":12}}}]); writeAndCheck([[{"foo/bar":{"op":"set","new":{"baz":12},"ttl":1}}]]); - wait(2.0); + wait(3.0); assertEqual(readAndCheck([["/foo"]]), [{"foo":{}}]); assertEqual(readAndCheck([["/foo/bar"]]), [{"foo":{}}]); assertEqual(readAndCheck([["/foo/bar/baz"]]), [{"foo":{}}]); From 9fd40f4c42f593d495748b8bc901566852e99ab8 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Wed, 18 Jan 2017 10:24:12 +0100 Subject: [PATCH 3/3] log fatal errors in the MSVC debug console --- lib/Logger/Logger.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Logger/Logger.cpp b/lib/Logger/Logger.cpp index 9481ef80a4..57d95c3472 100644 --- a/lib/Logger/Logger.cpp +++ b/lib/Logger/Logger.cpp @@ -219,6 +219,10 @@ void Logger::log(char const* function, char const* file, long int line, if (ArangoGlobalContext::CONTEXT != nullptr && ArangoGlobalContext::CONTEXT->useEventLog()) { TRI_LogWindowsEventlog(function, file, line, message); } + + // additionally log these errors to the debug output window in MSVC so + // we can see them during development + OutputDebugString(message.c_str()); } #endif