MCPcopy Create free account
hub / github.com/apache/mesos / convert

Function convert

3rdparty/libprocess/src/http.cpp:1194–1209  ·  view source on GitHub ↗

Returns a 'BODY' response once the body of the provided 'PIPE' response can be read completely.

Source from the content-addressed store, hash-verified

1192// Returns a 'BODY' response once the body of the provided
1193// 'PIPE' response can be read completely.
1194Future<Response> convert(const Response& pipeResponse)
1195{
1196 CHECK_EQ(Response::PIPE, pipeResponse.type);
1197 CHECK_SOME(pipeResponse.reader);
1198
1199 Pipe::Reader reader = pipeResponse.reader.get();
1200
1201 return reader.readAll()
1202 .then([pipeResponse](const string& body) {
1203 Response bodyResponse = pipeResponse;
1204 bodyResponse.type = Response::BODY;
1205 bodyResponse.body = body;
1206 bodyResponse.reader = None(); // Remove the reader.
1207 return bodyResponse;
1208 });
1209}
1210
1211
1212class ConnectionProcess : public Process<ConnectionProcess>

Callers 1

_readMethod · 0.70

Calls 4

NoneClass · 0.85
readAllMethod · 0.80
getMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected