1
0
Fork 0

The ShutdownHandler now uses VelocityPack instead of TRI_json_t

This commit is contained in:
Michael Hackstein 2015-11-06 14:36:14 +01:00
parent aff851ec81
commit 454b3f0d7a
1 changed files with 9 additions and 6 deletions

View File

@ -29,8 +29,6 @@
#include "RestShutdownHandler.h"
#include "Basics/json.h"
#include "Basics/tri-strings.h"
#include "Rest/HttpRequest.h"
using namespace std;
@ -83,10 +81,15 @@ bool RestShutdownHandler::isDirect () const {
HttpHandler::status_t RestShutdownHandler::execute () {
_applicationServer->beginShutdown();
TRI_json_t result;
TRI_InitStringJson(&result, TRI_DuplicateStringZ(TRI_CORE_MEM_ZONE, "OK"), strlen("OK"));
generateResult(&result);
TRI_DestroyJson(TRI_CORE_MEM_ZONE, &result);
try {
VPackBuilder json;
json.add(VPackValue("OK"));
VPackSlice slice(json.start());
generateResult(slice);
}
catch (...) {
// Ignore the error
}
return status_t(HANDLER_DONE);
}