mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-03 07:52:29 +02:00
testReuseSession: remove bad checks for session reuse
This commit is contained in:
parent
551b00c821
commit
746a69dc09
@ -371,7 +371,6 @@ void HTTPSClientSessionTest::testCachedSession()
|
|||||||
HTTPSClientSession s2("127.0.0.1", srv.port(), pClientContext, pSession1);
|
HTTPSClientSession s2("127.0.0.1", srv.port(), pClientContext, pSession1);
|
||||||
HTTPRequest request2(HTTPRequest::HTTP_GET, "/small");
|
HTTPRequest request2(HTTPRequest::HTTP_GET, "/small");
|
||||||
s2.sendRequest(request2);
|
s2.sendRequest(request2);
|
||||||
Session::Ptr pSession2 = s2.sslSession();
|
|
||||||
HTTPResponse response2;
|
HTTPResponse response2;
|
||||||
std::istream& rs2 = s2.receiveResponse(response2);
|
std::istream& rs2 = s2.receiveResponse(response2);
|
||||||
assertTrue (response2.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
assertTrue (response2.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
||||||
@ -380,11 +379,8 @@ void HTTPSClientSessionTest::testCachedSession()
|
|||||||
StreamCopier::copyStream(rs2, ostr2);
|
StreamCopier::copyStream(rs2, ostr2);
|
||||||
assertTrue (ostr2.str() == HTTPSTestServer::SMALL_BODY);
|
assertTrue (ostr2.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
|
|
||||||
assertTrue (pSession1 == pSession2);
|
|
||||||
|
|
||||||
HTTPRequest request3(HTTPRequest::HTTP_GET, "/small");
|
HTTPRequest request3(HTTPRequest::HTTP_GET, "/small");
|
||||||
s2.sendRequest(request3);
|
s2.sendRequest(request3);
|
||||||
Session::Ptr pSession3 = s2.sslSession();
|
|
||||||
HTTPResponse response3;
|
HTTPResponse response3;
|
||||||
std::istream& rs3 = s2.receiveResponse(response3);
|
std::istream& rs3 = s2.receiveResponse(response3);
|
||||||
assertTrue (response3.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
assertTrue (response3.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
||||||
@ -393,14 +389,11 @@ void HTTPSClientSessionTest::testCachedSession()
|
|||||||
StreamCopier::copyStream(rs3, ostr3);
|
StreamCopier::copyStream(rs3, ostr3);
|
||||||
assertTrue (ostr3.str() == HTTPSTestServer::SMALL_BODY);
|
assertTrue (ostr3.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
|
|
||||||
assertTrue (pSession1 == pSession3);
|
|
||||||
|
|
||||||
Thread::sleep(15000); // wait for session to expire
|
Thread::sleep(15000); // wait for session to expire
|
||||||
pServerContext->flushSessionCache();
|
pServerContext->flushSessionCache();
|
||||||
|
|
||||||
HTTPRequest request4(HTTPRequest::HTTP_GET, "/small");
|
HTTPRequest request4(HTTPRequest::HTTP_GET, "/small");
|
||||||
s2.sendRequest(request4);
|
s2.sendRequest(request4);
|
||||||
Session::Ptr pSession4 = s2.sslSession();
|
|
||||||
HTTPResponse response4;
|
HTTPResponse response4;
|
||||||
std::istream& rs4 = s2.receiveResponse(response4);
|
std::istream& rs4 = s2.receiveResponse(response4);
|
||||||
assertTrue (response4.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
assertTrue (response4.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
||||||
@ -408,8 +401,6 @@ void HTTPSClientSessionTest::testCachedSession()
|
|||||||
std::ostringstream ostr4;
|
std::ostringstream ostr4;
|
||||||
StreamCopier::copyStream(rs4, ostr4);
|
StreamCopier::copyStream(rs4, ostr4);
|
||||||
assertTrue (ostr4.str() == HTTPSTestServer::SMALL_BODY);
|
assertTrue (ostr4.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
|
|
||||||
assertTrue (pSession1 != pSession4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user