mirror of https://gitee.com/bigwinds/arangodb
fix arangosh with vst
This commit is contained in:
parent
9444bcf650
commit
35c62f390f
|
@ -142,7 +142,7 @@ RequestHeader requestHeaderFromSlice(velocypack::Slice const& header);
|
||||||
/// creates a RequestHeader from a given slice
|
/// creates a RequestHeader from a given slice
|
||||||
ResponseHeader responseHeaderFromSlice(velocypack::Slice const& header);
|
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);
|
std::size_t validateAndCount(uint8_t const* vpHeaderStart, std::size_t len);
|
||||||
|
|
||||||
} // namespace parser
|
} // namespace parser
|
||||||
|
|
|
@ -70,8 +70,8 @@ struct MessageHeader {
|
||||||
protected:
|
protected:
|
||||||
StringMap _meta; /// Header meta data (equivalent to HTTP headers)
|
StringMap _meta; /// Header meta data (equivalent to HTTP headers)
|
||||||
short _version;
|
short _version;
|
||||||
ContentType _contentType;
|
ContentType _contentType = ContentType::Unset;
|
||||||
ContentType _acceptType;
|
ContentType _acceptType = ContentType::Unset;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RequestHeader final : public MessageHeader {
|
struct RequestHeader final : public MessageHeader {
|
||||||
|
|
|
@ -170,8 +170,6 @@ void message::requestHeader(RequestHeader const& header,
|
||||||
/// @brief creates a slice containing a VST response-message header.
|
/// @brief creates a slice containing a VST response-message header.
|
||||||
void message::responseHeader(ResponseHeader const& header,
|
void message::responseHeader(ResponseHeader const& header,
|
||||||
VPackBuffer<uint8_t>& buffer) {
|
VPackBuffer<uint8_t>& buffer) {
|
||||||
static std::string const message = " for message not set";
|
|
||||||
|
|
||||||
VPackBuilder builder(buffer);
|
VPackBuilder builder(buffer);
|
||||||
assert(builder.isClosed());
|
assert(builder.isClosed());
|
||||||
builder.openArray();
|
builder.openArray();
|
||||||
|
@ -505,7 +503,6 @@ ResponseHeader responseHeaderFromSlice(VPackSlice const& headerSlice) {
|
||||||
assert(headerSlice.at(1).getNumber<int>() ==
|
assert(headerSlice.at(1).getNumber<int>() ==
|
||||||
static_cast<int>(MessageType::Response));
|
static_cast<int>(MessageType::Response));
|
||||||
header.responseCode = headerSlice.at(2).getNumber<StatusCode>();
|
header.responseCode = headerSlice.at(2).getNumber<StatusCode>();
|
||||||
// header.contentType(ContentType::VPack); // empty meta
|
|
||||||
if (headerSlice.length() >= 4) {
|
if (headerSlice.length() >= 4) {
|
||||||
VPackSlice meta = headerSlice.at(3);
|
VPackSlice meta = headerSlice.at(3);
|
||||||
assert(meta.isObject());
|
assert(meta.isObject());
|
||||||
|
@ -521,9 +518,9 @@ ResponseHeader responseHeaderFromSlice(VPackSlice const& headerSlice) {
|
||||||
header.contentType(ContentType::VPack);
|
header.contentType(ContentType::VPack);
|
||||||
}
|
}
|
||||||
return header;
|
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) {
|
std::size_t validateAndCount(uint8_t const* const vpStart, std::size_t length) {
|
||||||
// start points to the begin of a velocypack
|
// start points to the begin of a velocypack
|
||||||
uint8_t const* cursor = vpStart;
|
uint8_t const* cursor = vpStart;
|
||||||
|
|
Loading…
Reference in New Issue