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

Function convert

3rdparty/libprocess/src/process.cpp:717–731  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

715// Returns a 'BODY' request once the body of the provided
716// 'PIPE' request can be read completely.
717static Future<Owned<Request>> convert(Owned<Request>&& pipeRequest)
718{
719 CHECK_EQ(Request::PIPE, pipeRequest->type);
720 CHECK_SOME(pipeRequest->reader);
721 CHECK(pipeRequest->body.empty());
722
723 return pipeRequest->reader->readAll()
724 .then([pipeRequest](const string& body) -> Future<Owned<Request>> {
725 pipeRequest->type = Request::BODY;
726 pipeRequest->body = body;
727 pipeRequest->reader = None(); // Remove the reader.
728
729 return pipeRequest;
730 });
731}
732
733
734static Future<MessageEvent*> parse(const Request& request)

Callers 1

consumeMethod · 0.70

Calls 4

NoneClass · 0.85
readAllMethod · 0.80
emptyMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected