Returns a 'BODY' request once the body of the provided 'PIPE' request can be read completely.
| 715 | // Returns a 'BODY' request once the body of the provided |
| 716 | // 'PIPE' request can be read completely. |
| 717 | static 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 | |
| 734 | static Future<MessageEvent*> parse(const Request& request) |