MCPcopy Create free account
hub / github.com/acl-dev/acl / http_client

Method http_client

lib_acl_cpp/samples/master/master_http_aio/http_client.cpp:4–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include "http_client.h"
3
4http_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
22http_client::~http_client()
23{

Callers

nothing calls this directly

Calls 2

get_astreamMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected