2014-11-19 00:25:21 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
// <20><><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
acl::socket_stream* connect_server();
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD> HTTP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
bool http_request(acl::socket_stream* conn, const char* host);
|
|
|
|
|
};
|