make TCPServer and HTTPClientSession work with UNIX local sockets

This commit is contained in:
Guenter Obiltschnig
2015-09-08 17:06:30 +02:00
parent 515de4128f
commit 0494abc603
2 changed files with 8 additions and 3 deletions

View File

@@ -205,7 +205,7 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
reconnect(); reconnect();
if (!keepAlive) if (!keepAlive)
request.setKeepAlive(false); request.setKeepAlive(false);
if (!request.has(HTTPRequest::HOST)) if (!request.has(HTTPRequest::HOST) && !_host.empty())
request.setHost(_host, _port); request.setHost(_host, _port);
if (!_proxyConfig.host.empty() && !bypassProxy()) if (!_proxyConfig.host.empty() && !bypassProxy())
{ {

View File

@@ -120,8 +120,13 @@ void TCPServer::run()
try try
{ {
StreamSocket ss = _socket.acceptConnection(); StreamSocket ss = _socket.acceptConnection();
// enabe nodelay per default: OSX really needs that // enable nodelay per default: OSX really needs that
#if defined(POCO_OS_FAMILY_UNIX)
if (ss.address().family() != AddressFamily::UNIX_LOCAL)
#endif
{
ss.setNoDelay(true); ss.setNoDelay(true);
}
_pDispatcher->enqueue(ss); _pDispatcher->enqueue(ss);
} }
catch (Poco::Exception& exc) catch (Poco::Exception& exc)