Merge pull request #19 from pocoproject/develop

Syn 16.9.2015 - 2
This commit is contained in:
Marian Krivoš 2015-09-16 12:27:22 +02:00
commit f43d3f01bb
5 changed files with 18 additions and 0 deletions

View File

@ -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;

View File

@ -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

View File

@ -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";

View File

@ -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;

View File

@ -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
}