mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-18 12:19:30 +01:00
commit
f43d3f01bb
@ -136,6 +136,7 @@ public:
|
||||
static const std::string HTTP_DELETE;
|
||||
static const std::string HTTP_TRACE;
|
||||
static const std::string HTTP_CONNECT;
|
||||
static const std::string HTTP_PATCH;
|
||||
|
||||
static const std::string HOST;
|
||||
static const std::string COOKIE;
|
||||
|
@ -91,6 +91,10 @@ public:
|
||||
/// 192.168.1.10:80
|
||||
/// [::ffff:192.168.1.120]:2040
|
||||
/// www.appinf.com:8080
|
||||
///
|
||||
/// On POSIX platforms supporting UNIX_LOCAL sockets, hostAndPort
|
||||
/// can also be the absolute path of a local socket, starting with a
|
||||
/// slash, e.g. "/tmp/local.socket".
|
||||
|
||||
SocketAddress(Family family, const std::string& addr);
|
||||
/// Creates a SocketAddress of the given family from a
|
||||
|
@ -37,6 +37,7 @@ const std::string HTTPRequest::HTTP_OPTIONS = "OPTIONS";
|
||||
const std::string HTTPRequest::HTTP_DELETE = "DELETE";
|
||||
const std::string HTTPRequest::HTTP_TRACE = "TRACE";
|
||||
const std::string HTTPRequest::HTTP_CONNECT = "CONNECT";
|
||||
const std::string HTTPRequest::HTTP_PATCH = "PATCH";
|
||||
const std::string HTTPRequest::HOST = "Host";
|
||||
const std::string HTTPRequest::COOKIE = "Cookie";
|
||||
const std::string HTTPRequest::AUTHORIZATION = "Authorization";
|
||||
|
@ -285,6 +285,14 @@ void SocketAddress::init(const std::string& hostAndPort)
|
||||
std::string port;
|
||||
std::string::const_iterator it = hostAndPort.begin();
|
||||
std::string::const_iterator end = hostAndPort.end();
|
||||
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
if (*it == '/')
|
||||
{
|
||||
newLocal(hostAndPort);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (*it == '[')
|
||||
{
|
||||
++it;
|
||||
|
@ -170,6 +170,10 @@ void SocketAddressTest::testSocketAddressUnixLocal()
|
||||
SocketAddress sa3(SocketAddress::UNIX_LOCAL, "/tmp/sock1");
|
||||
assert (sa1 == sa3);
|
||||
assert (!(sa1 < sa3));
|
||||
|
||||
SocketAddress sa4("/tmp/sock1");
|
||||
assert (sa1 == sa4);
|
||||
assert (sa4.toString() == "/tmp/sock1");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user