| 545 | } |
| 546 | |
| 547 | void HTTPRequest::WriteReplyChunk(std::string_view strReply) { |
| 548 | struct evbuffer *evb = evbuffer_new(); |
| 549 | evbuffer_add(evb, strReply.data(), strReply.length()); |
| 550 | |
| 551 | // Send event to main http thread to send reply message |
| 552 | HTTPEvent *ev = new HTTPEvent(eventBase, true, std::bind(evhttp_send_reply_chunk, req, evb)); |
| 553 | ev->trigger(nullptr); |
| 554 | |
| 555 | HTTPEvent *evDel = new HTTPEvent(eventBase, true, std::bind(evbuffer_free, evb)); |
| 556 | evDel->trigger(nullptr); |
| 557 | } |
| 558 | |
| 559 | void HTTPRequest::StopWritingChunks() { |
| 560 | HTTPEvent *ev = new HTTPEvent(eventBase, true, std::bind(evhttp_send_reply_end, req)); |
no test coverage detected