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

Method open

lib_acl_cpp/samples/aio/http_client/http_client.cpp:66–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66bool http_client::open(void)
67{
68 http_stream* conn = new http_stream(handle_, *this);
69
70 conn->unzip_body(true);
71
72 acl::http_header& hdr = conn->request_header();
73 hdr.set_url(url_)
74 .set_host(host_)
75 .accept_gzip(true)
76 .set_keep_alive(keep_alive_);
77
78 acl::string buf;
79 hdr.build_request(buf);
80 printf("---------------request header-----------------\r\n");
81 printf("[%s]\r\n", buf.c_str());
82
83 if (!conn->open(addr_, conn_timeout_, rw_timeout_)) {
84 delete conn;
85 return false;
86 }
87
88 ++__aio_refer;
89
90 // 本对象的引用计数递增
91 refered_++;
92 return true;
93}
94
95bool http_client::redirect(const char* url)
96{

Callers 13

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
client_mainFunction · 0.45
on_acceptMethod · 0.45
mainFunction · 0.45
thread_writerMethod · 0.45
thread_readerMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 5

request_headerMethod · 0.80
set_keep_aliveMethod · 0.80
accept_gzipMethod · 0.80
build_requestMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected