mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-14 17:00:52 +08:00
39 lines
643 B
C
39 lines
643 B
C
|
#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);
|
|||
|
};
|