Overview
Features
Download
Documentation
Community
Add-Ons & Services

HTTPClientSession doesn't work with proxy when DNS fails

Please post support and help requests here.

HTTPClientSession doesn't work with proxy when DNS fails

Postby awang » 21 Sep 2012, 10:35

HTTPClientSession::proxyConnect() function tries to resolve the name of the target host by doing:

SocketAddress targetAddress(getHost(), getPort());
HTTPRequest proxyRequest(HTTPRequest::HTTP_CONNECT, targetAddress.toString(), HTTPMessage::HTTP_1_1);

This is not necessary, and in some environment, where DNS doesn't work, this will fail. When HTTP proxy is used, normally don't have to do DNS. Just put the host name into the proxyRequest is all required. So a fix like this would be better:

std::string dest = getHost();
dest.append(":");
NumberFormatter::append(dest, getPort());
HTTPRequest proxyRequest(HTTPRequest::HTTP_CONNECT, dest, HTTPMessage::HTTP_1_1);
awang
 
Posts: 1
Joined: 21 Sep 2012, 10:28

Re: HTTPClientSession doesn't work with proxy when DNS fails

Postby alex » 21 Sep 2012, 15:41

Thanks, I filed a SF patch and we'll look into it.
alex
 
Posts: 1143
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron