GH #68: DNS::hostByAddress can be slow

GH #68: DNS::hostByAddress can be slow - added parameters in the
interface to pass hint flags to hostByAddress() and hostByName() calls
This commit is contained in:
Aleksandar Fabijanic
2013-03-24 14:36:28 -05:00
parent 4c593dba7a
commit 22b658a838
3 changed files with 52 additions and 13 deletions

View File

@@ -167,13 +167,15 @@ void HTTPClientSessionTest::testPostLargeChunked()
HTTPRequest request(HTTPRequest::HTTP_POST, "/echo");
std::string body(16000, 'x');
request.setChunkedTransferEncoding(true);
s.sendRequest(request) << body;
std::ostream& os = s.sendRequest(request);
os << body;
os.flush();
HTTPResponse response;
std::istream& rs = s.receiveResponse(response);
assert (response.getChunkedTransferEncoding());
assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH);
std::ostringstream ostr;
StreamCopier::copyStream(rs, ostr);
StreamCopier::copyStream(rs, ostr, 16000);
assert (ostr.str() == body);
}