| 723 | } |
| 724 | |
| 725 | static int on_body(http_parser* p, const char* data, size_t length) |
| 726 | { |
| 727 | StreamingResponseDecoder* decoder = (StreamingResponseDecoder*) p->data; |
| 728 | |
| 729 | CHECK_SOME(decoder->writer); |
| 730 | |
| 731 | http::Pipe::Writer writer = decoder->writer.get(); // Remove const. |
| 732 | writer.write(std::string(data, length)); |
| 733 | |
| 734 | return http_parsing::SUCCESS; |
| 735 | } |
| 736 | |
| 737 | static int on_message_complete(http_parser* p) |
| 738 | { |