2013-08-18 17:42:25 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
#include "acl_cpp/acl_cpp_define.hpp"
|
|
|
|
|
|
|
|
|
|
namespace acl {
|
|
|
|
|
|
|
|
|
|
class ACL_CPP_API http_utils
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
http_utils() {}
|
|
|
|
|
~http_utils() {}
|
|
|
|
|
|
|
|
|
|
/**
|
2013-12-07 20:31:59 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> url <EFBFBD>л<EFBFBD><EFBFBD><EFBFBD> WEB <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>domain:port
|
2013-08-18 17:42:25 +08:00
|
|
|
|
* @param url {const char*} HTTP url<EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
2013-12-07 20:31:59 +08:00
|
|
|
|
* @param addr {char*} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>domain:port
|
2013-08-18 17:42:25 +08:00
|
|
|
|
* @param size {size_t} out <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2013-12-07 20:31:59 +08:00
|
|
|
|
static bool get_addr(const char* url, char* addr, size_t size);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> url <EFBFBD>л<EFBFBD><EFBFBD><EFBFBD> WEB <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IP <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>˿ں<EFBFBD>
|
|
|
|
|
* @param url {const char*} HTTP url<EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @param domain {char*} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param size {size_t} domain <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
* @param port {unsigned short*} <EFBFBD>洢<EFBFBD>˿ںŴ<EFBFBD>С
|
|
|
|
|
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
static bool get_addr(const char* url, char* domain, size_t size,
|
|
|
|
|
unsigned short* port);
|
2013-08-18 17:42:25 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acl
|