2019-07-28 10:31:56 +08:00
|
|
|
|
#pragma once
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
class db_store;
|
|
|
|
|
|
|
|
|
|
class http_thread : public acl::thread
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
http_thread(const char* domain, const char* ip, int port,
|
|
|
|
|
const char* url, double spent_dns);
|
|
|
|
|
~http_thread();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void* run();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
acl::string domain_;
|
|
|
|
|
acl::string ip_;
|
|
|
|
|
int port_;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
friend class db_store;
|
|
|
|
|
|
|
|
|
|
acl::string url_;
|
|
|
|
|
double spent_dns_;
|
|
|
|
|
double spent_connect_;
|
|
|
|
|
double spent_http_;
|
|
|
|
|
double spent_total_;
|
|
|
|
|
int length_;
|
|
|
|
|
bool success_;
|
|
|
|
|
char addr_[256];
|
|
|
|
|
|
|
|
|
|
private:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
acl::socket_stream* connect_server();
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD> HTTP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
bool http_request(acl::socket_stream* conn, const char* host);
|
|
|
|
|
};
|