| 2 | #include "http_client.h" |
| 3 | |
| 4 | http_client::http_client(acl::aio_socket_stream* conn, int buf_size) |
| 5 | : conn_(conn) |
| 6 | , res_body_(buf_size) |
| 7 | , keep_alive_(false) |
| 8 | { |
| 9 | stream_ = conn->get_astream(); |
| 10 | for (int i = 0; i < buf_size; i++) |
| 11 | res_body_ << 'X'; |
| 12 | res_hdr_.format("HTTP/1.1 200 OK\r\n" |
| 13 | "Content-Length: %d\r\n" |
| 14 | "Connection: keep-alive\r\n\r\n", |
| 15 | buf_size); |
| 16 | res_hdr2_.format("HTTP/1.1 200 OK\r\n" |
| 17 | "Content-Length: %d\r\n" |
| 18 | "Connection: close\r\n\r\n", |
| 19 | buf_size); |
| 20 | } |
| 21 | |
| 22 | http_client::~http_client() |
| 23 | { |
nothing calls this directly
no test coverage detected