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

Method http_download

lib_acl_cpp/src/http/http_download.cpp:13–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12
13http_download::http_download(const char* url, const char* addr /* = NULL */)
14{
15 if (addr) {
16 ACL_SAFE_STRNCPY(addr_, addr, sizeof(addr_));
17 } else if (!http_utils::get_addr(url, addr_, sizeof(addr_))) {
18 logger_error("url(%s) invalid", url);
19 addr_[0] = 0;
20 url_ = NULL;
21 req_ = NULL;
22 return;
23 }
24
25 url_ = acl_mystrdup(url);
26 req_ = NEW http_request(addr_); // HTTP �������
27 req_->request_header().set_url(url_)
28 .set_content_type("text/html")
29 .set_host(addr_);
30}
31
32http_download::~http_download()
33{

Callers

nothing calls this directly

Calls 4

set_content_typeMethod · 0.80
request_headerMethod · 0.80
get_addrFunction · 0.50
http_requestClass · 0.50

Tested by

no test coverage detected