| 11 | { |
| 12 | |
| 13 | http_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 | |
| 32 | http_download::~http_download() |
| 33 | { |
nothing calls this directly
no test coverage detected