1
0
Fork 0

fix arangosh with vst

This commit is contained in:
jsteemann 2019-10-09 18:55:43 +02:00
parent 9444bcf650
commit 35c62f390f
3 changed files with 5 additions and 8 deletions

View File

@ -142,7 +142,7 @@ RequestHeader requestHeaderFromSlice(velocypack::Slice const& header);
/// creates a RequestHeader from a given slice
ResponseHeader responseHeaderFromSlice(velocypack::Slice const& header);
// Validates if payload consitsts of valid velocypack slices
// Validates if payload consists of valid velocypack slices
std::size_t validateAndCount(uint8_t const* vpHeaderStart, std::size_t len);
} // namespace parser

View File

@ -70,8 +70,8 @@ struct MessageHeader {
protected:
StringMap _meta; /// Header meta data (equivalent to HTTP headers)
short _version;
ContentType _contentType;
ContentType _acceptType;
ContentType _contentType = ContentType::Unset;
ContentType _acceptType = ContentType::Unset;
};
struct RequestHeader final : public MessageHeader {

View File

@ -170,8 +170,6 @@ void message::requestHeader(RequestHeader const& header,
/// @brief creates a slice containing a VST response-message header.
void message::responseHeader(ResponseHeader const& header,
VPackBuffer<uint8_t>& buffer) {
static std::string const message = " for message not set";
VPackBuilder builder(buffer);
assert(builder.isClosed());
builder.openArray();
@ -505,7 +503,6 @@ ResponseHeader responseHeaderFromSlice(VPackSlice const& headerSlice) {
assert(headerSlice.at(1).getNumber<int>() ==
static_cast<int>(MessageType::Response));
header.responseCode = headerSlice.at(2).getNumber<StatusCode>();
// header.contentType(ContentType::VPack); // empty meta
if (headerSlice.length() >= 4) {
VPackSlice meta = headerSlice.at(3);
assert(meta.isObject());
@ -521,9 +518,9 @@ ResponseHeader responseHeaderFromSlice(VPackSlice const& headerSlice) {
header.contentType(ContentType::VPack);
}
return header;
};
}
// Validates if payload consitsts of valid velocypack slices
// Validates if payload consists of valid velocypack slices
std::size_t validateAndCount(uint8_t const* const vpStart, std::size_t length) {
// start points to the begin of a velocypack
uint8_t const* cursor = vpStart;