2014-11-19 00:25:21 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
class https_client : public acl::thread
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
https_client(const char* server_addr, const char* domain,
|
|
|
|
|
bool keep_alive, int count, int length);
|
|
|
|
|
~https_client();
|
|
|
|
|
|
|
|
|
|
void set_ssl_conf(acl::polarssl_conf* conf);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void* run(); // <20><><EFBFBD><EFBFBD><EFBFBD>麯<EFBFBD><E9BAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
acl::string server_addr_; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
acl::string domain_; // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
bool keep_alive_; // <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD>ӷ<EFBFBD>ʽ
|
|
|
|
|
int count_; // IO <20>Ự<EFBFBD><E1BBB0><EFBFBD><EFBFBD>
|
|
|
|
|
int length_; // ÿ<><C3BF> IO <20><><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
|
|
|
|
acl::polarssl_conf* ssl_conf_;
|
|
|
|
|
|
|
|
|
|
bool connect_server(acl::http_client& client);
|
|
|
|
|
int http_request(int count);
|
|
|
|
|
};
|