mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 08:31:43 +02:00
synchronized trunk
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPClientSession.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTTPClientSession.cpp#18 $
|
||||
// $Id: //poco/Main/Net/src/HTTPClientSession.cpp#19 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTPClient
|
||||
@@ -184,7 +184,8 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
|
||||
reconnect();
|
||||
if (!keepAlive)
|
||||
request.setKeepAlive(false);
|
||||
request.setHost(_host, _port);
|
||||
if (!request.has(HTTPRequest::HOST))
|
||||
request.setHost(_host, _port);
|
||||
if (!_proxyHost.empty())
|
||||
request.setURI(getHostInfo() + request.getURI());
|
||||
_reconnect = keepAlive;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPServerRequestImpl.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTTPServerRequestImpl.cpp#2 $
|
||||
// $Id: //poco/Main/Net/src/HTTPServerRequestImpl.cpp#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTPServer
|
||||
@@ -54,9 +54,7 @@ namespace Net {
|
||||
HTTPServerRequestImpl::HTTPServerRequestImpl(HTTPServerResponse& response, HTTPServerSession& session, HTTPServerParams* pParams):
|
||||
_response(response),
|
||||
_pStream(0),
|
||||
_pParams(pParams),
|
||||
_clientAddress(session.clientAddress()),
|
||||
_serverAddress(session.serverAddress())
|
||||
_pParams(pParams)
|
||||
{
|
||||
poco_check_ptr (_pParams);
|
||||
|
||||
@@ -65,6 +63,10 @@ HTTPServerRequestImpl::HTTPServerRequestImpl(HTTPServerResponse& response, HTTPS
|
||||
HTTPHeaderInputStream hs(session);
|
||||
read(hs);
|
||||
|
||||
// Now that we know socket is still connected, obtain addresses
|
||||
_clientAddress = session.clientAddress();
|
||||
_serverAddress = session.serverAddress();
|
||||
|
||||
if (getChunkedTransferEncoding())
|
||||
_pStream = new HTTPChunkedInputStream(session);
|
||||
else if (getContentLength() != HTTPMessage::UNKNOWN_CONTENT_LENGTH)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// NetworkInterface.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/NetworkInterface.cpp#20 $
|
||||
// $Id: //poco/Main/Net/src/NetworkInterface.cpp#21 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@@ -394,7 +394,7 @@ NetworkInterface::NetworkInterfaceList NetworkInterface::list()
|
||||
#endif
|
||||
|
||||
// Add IPv4 loopback interface (not returned by GetAdaptersInfo)
|
||||
result.push_back(NetworkInterface("Loopback", IPAddress("127.0.0.1"), -1));
|
||||
result.push_back(NetworkInterface("Loopback", IPAddress("127.0.0.1"), IPAddress("255.0.0.0"), IPAddress(), -1));
|
||||
// On Windows 2000 we use GetAdaptersInfo.
|
||||
PIP_ADAPTER_INFO pAdapterInfo;
|
||||
PIP_ADAPTER_INFO pInfo = 0;
|
||||
@@ -420,10 +420,13 @@ NetworkInterface::NetworkInterfaceList NetworkInterface::list()
|
||||
while (pInfo)
|
||||
{
|
||||
IPAddress address(std::string(pInfo->IpAddressList.IpAddress.String));
|
||||
IPAddress subnetMask(std::string(pInfo->IpAddressList.IpMask.String));
|
||||
IPAddress broadcastAddress(address);
|
||||
broadcastAddress.mask(subnetMask, IPAddress("255.255.255.255"));
|
||||
result.push_back(NetworkInterface(std::string(pInfo->AdapterName), address, subnetMask, broadcastAddress));
|
||||
if (!address.isWildcard()) // only return interfaces that have an address assigned.
|
||||
{
|
||||
IPAddress subnetMask(std::string(pInfo->IpAddressList.IpMask.String));
|
||||
IPAddress broadcastAddress(address);
|
||||
broadcastAddress.mask(subnetMask, IPAddress("255.255.255.255"));
|
||||
result.push_back(NetworkInterface(std::string(pInfo->AdapterName), address, subnetMask, broadcastAddress));
|
||||
}
|
||||
pInfo = pInfo->Next;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user