Overview
Features
Download
Documentation
Community
Add-Ons & Services

HTTPClientSession doesn't work with proxy when DNS fails

Please post support and help requests here.
awang
Posts: 1
Joined: 21 Sep 2012, 10:28

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

alex
Posts: 1212
Joined: 11 Jul 2006, 16:27
Location: United_States

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.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 2 guests