| 73 | } |
| 74 | |
| 75 | void http_client::reset(void) |
| 76 | { |
| 77 | if (buf_) { |
| 78 | buf_->clear(); |
| 79 | } |
| 80 | |
| 81 | if (res_) { |
| 82 | // ˵���dz����ӵĵڶ�������������Ҫ���ϴ������ |
| 83 | // ��Ӧͷ������Ӧ������ͷ� |
| 84 | |
| 85 | acl_assert(hdr_res_); |
| 86 | http_res_free(res_); |
| 87 | hdr_res_ = NULL; |
| 88 | res_ = NULL; |
| 89 | } else if (hdr_res_) { |
| 90 | // ˵���dz����ӵĵڶ���������Ϊ�п��ܵ�һ������ |
| 91 | // ֻ����Ӧͷ�����Խ���Ҫ�ͷ��ϴε���Ӧͷ���� |
| 92 | |
| 93 | http_hdr_res_free(hdr_res_); |
| 94 | hdr_res_ = NULL; |
| 95 | } |
| 96 | |
| 97 | if (req_) { |
| 98 | acl_assert(hdr_req_); |
| 99 | http_req_free(req_); |
| 100 | hdr_req_ = NULL; |
| 101 | req_ = NULL; |
| 102 | } else if (hdr_req_) { |
| 103 | http_hdr_req_free(hdr_req_); |
| 104 | hdr_req_ = NULL; |
| 105 | } |
| 106 | |
| 107 | delete zstream_; |
| 108 | zstream_ = NULL; |
| 109 | |
| 110 | last_ret_ = -1; |
| 111 | head_sent_ = false; |
| 112 | body_finish_ = false; |
| 113 | chunked_transfer_ = false; |
| 114 | gzip_crc32_ = 0; |
| 115 | gzip_total_in_ = 0; |
| 116 | } |
| 117 | |
| 118 | bool http_client::open(const char* addr, int conn_timeout /* = 60 */, |
| 119 | int rw_timeout /* = 60 */, bool unzip /* = true */) |
nothing calls this directly
no test coverage detected