blob: a58a4cea8afd0abc7e9c7321349041d48a820803 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vbench/http/http_result_handler.h>
#include <vespa/vespalib/data/simple_buffer.h>
namespace vbench {
using SimpleBuffer = vespalib::SimpleBuffer;
class SimpleHttpResultHandler : public HttpResultHandler
{
private:
std::vector<std::pair<string, string> > _headers;
SimpleBuffer _content;
std::vector<string> _failures;
public:
SimpleHttpResultHandler();
virtual void handleHeader(const string &name, const string &value) override;
virtual void handleContent(const Memory &data) override;
virtual void handleFailure(const string &reason) override;
const std::vector<std::pair<string, string> > &headers() const {
return _headers;
}
Memory content() const { return _content.get(); }
const std::vector<string> &failures() const { return _failures; }
};
} // namespace vbench
|