blob: a09a4d30a220ccbebb2539faaf67631a2f412551 (
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
34
35
36
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/fastos/fastos.h>
#include "simple_http_result_handler.h"
namespace vbench {
SimpleHttpResultHandler::SimpleHttpResultHandler()
: _headers(),
_content(),
_failures()
{
}
void
SimpleHttpResultHandler::handleHeader(const string &name, const string &value)
{
_headers.push_back(std::make_pair(name, value));
}
void
SimpleHttpResultHandler::handleContent(const Memory &data)
{
WritableMemory wm = _content.reserve(data.size);
memcpy(wm.data, data.data, data.size);
_content.commit(data.size);
}
void
SimpleHttpResultHandler::handleFailure(const string &reason)
{
_failures.push_back(reason);
}
} // namespace vbench
|