mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 02:22:57 +01:00
Merge branch 'poco-1.10.0' of https://github.com/pocoproject/poco into poco-1.10.0
This commit is contained in:
commit
4e87b69de4
@ -199,16 +199,6 @@ extern "C" int ApacheConnector_handler(request_rec *r)
|
|||||||
const char* clientIp = r->connection->client_ip;
|
const char* clientIp = r->connection->client_ip;
|
||||||
apr_port_t clientPort = r->connection->client_addr->port;
|
apr_port_t clientPort = r->connection->client_addr->port;
|
||||||
#endif
|
#endif
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<ApacheServerRequest> pRequest(new ApacheServerRequest(
|
|
||||||
&rec,
|
|
||||||
r->connection->local_ip,
|
|
||||||
r->connection->local_addr->port,
|
|
||||||
clientIp,
|
|
||||||
clientPort));
|
|
||||||
|
|
||||||
std::auto_ptr<ApacheServerResponse> pResponse(new ApacheServerResponse(pRequest.get()));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<ApacheServerRequest> pRequest(new ApacheServerRequest(
|
std::unique_ptr<ApacheServerRequest> pRequest(new ApacheServerRequest(
|
||||||
&rec,
|
&rec,
|
||||||
r->connection->local_ip,
|
r->connection->local_ip,
|
||||||
@ -217,7 +207,6 @@ extern "C" int ApacheConnector_handler(request_rec *r)
|
|||||||
clientPort));
|
clientPort));
|
||||||
|
|
||||||
std::unique_ptr<ApacheServerResponse> pResponse(new ApacheServerResponse(pRequest.get()));
|
std::unique_ptr<ApacheServerResponse> pResponse(new ApacheServerResponse(pRequest.get()));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
|
|
||||||
// add header information to request
|
// add header information to request
|
||||||
rec.copyHeaders(*pRequest);
|
rec.copyHeaders(*pRequest);
|
||||||
@ -225,11 +214,7 @@ extern "C" int ApacheConnector_handler(request_rec *r)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<HTTPRequestHandler> pHandler(app.factory().createRequestHandler(*pRequest));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<HTTPRequestHandler> pHandler(app.factory().createRequestHandler(*pRequest));
|
std::unique_ptr<HTTPRequestHandler> pHandler(app.factory().createRequestHandler(*pRequest));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
|
|
||||||
if (pHandler.get())
|
if (pHandler.get())
|
||||||
{
|
{
|
||||||
|
@ -81,11 +81,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
TestMethod _test;
|
TestMethod _test;
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<Fixture> _fixture;
|
|
||||||
#else
|
|
||||||
std::unique_ptr<Fixture> _fixture;
|
std::unique_ptr<Fixture> _fixture;
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,11 +90,7 @@ private:
|
|||||||
void load(PKCS12* pPKCS12, const std::string& password = "");
|
void load(PKCS12* pPKCS12, const std::string& password = "");
|
||||||
std::string extractFriendlyName(X509* pCert);
|
std::string extractFriendlyName(X509* pCert);
|
||||||
|
|
||||||
#ifdef POCO_ENABLE_CPP11
|
|
||||||
typedef std::unique_ptr<X509Certificate> CertPtr;
|
typedef std::unique_ptr<X509Certificate> CertPtr;
|
||||||
#else
|
|
||||||
typedef std::auto_ptr<X509Certificate> CertPtr;
|
|
||||||
#endif // #ifdef POCO_ENABLE_CPP11
|
|
||||||
|
|
||||||
OpenSSLInitializer _openSSLInitializer;
|
OpenSSLInitializer _openSSLInitializer;
|
||||||
EVP_PKEY* _pKey;
|
EVP_PKEY* _pKey;
|
||||||
|
@ -87,11 +87,7 @@ public:
|
|||||||
|
|
||||||
FastMutex::ScopedLock lock(_mutex);
|
FastMutex::ScopedLock lock(_mutex);
|
||||||
|
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<AbstractFactory> ptr(pAbstractFactory);
|
|
||||||
#else
|
|
||||||
std::unique_ptr<AbstractFactory> ptr(pAbstractFactory);
|
std::unique_ptr<AbstractFactory> ptr(pAbstractFactory);
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
|
|
||||||
typename FactoryMap::iterator it = _map.find(className);
|
typename FactoryMap::iterator it = _map.find(className);
|
||||||
if (it == _map.end())
|
if (it == _map.end())
|
||||||
|
@ -58,11 +58,7 @@ void pad(std::string& str, int precision, int width, char prefix = ' ', char dec
|
|||||||
std::string::size_type frac = str.length() - decSepPos - 1;
|
std::string::size_type frac = str.length() - decSepPos - 1;
|
||||||
|
|
||||||
std::string::size_type ePos = str.find_first_of("eE");
|
std::string::size_type ePos = str.find_first_of("eE");
|
||||||
#ifdef POCO_ENABLE_CPP11
|
|
||||||
std::unique_ptr<std::string> eStr;
|
std::unique_ptr<std::string> eStr;
|
||||||
#else
|
|
||||||
std::auto_ptr<std::string> eStr;
|
|
||||||
#endif
|
|
||||||
if (ePos != std::string::npos)
|
if (ePos != std::string::npos)
|
||||||
{
|
{
|
||||||
eStr.reset(new std::string(str.substr(ePos, std::string::npos)));
|
eStr.reset(new std::string(str.substr(ePos, std::string::npos)));
|
||||||
|
@ -66,13 +66,8 @@ void DynamicFactoryTest::testDynamicFactory()
|
|||||||
|
|
||||||
assertTrue (!dynFactory.isClass("C"));
|
assertTrue (!dynFactory.isClass("C"));
|
||||||
|
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<A> a(dynamic_cast<A*>(dynFactory.createInstance("A")));
|
|
||||||
std::auto_ptr<B> b(dynamic_cast<B*>(dynFactory.createInstance("B")));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<A> a(dynamic_cast<A*>(dynFactory.createInstance("A")));
|
std::unique_ptr<A> a(dynamic_cast<A*>(dynFactory.createInstance("A")));
|
||||||
std::unique_ptr<B> b(dynamic_cast<B*>(dynFactory.createInstance("B")));
|
std::unique_ptr<B> b(dynamic_cast<B*>(dynFactory.createInstance("B")));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
|
|
||||||
assertNotNull(a.get());
|
assertNotNull(a.get());
|
||||||
assertNotNull(b.get());
|
assertNotNull(b.get());
|
||||||
@ -92,11 +87,7 @@ void DynamicFactoryTest::testDynamicFactory()
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<B> b(dynamic_cast<B*>(dynFactory.createInstance("B")));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<B> b(dynamic_cast<B*>(dynFactory.createInstance("B")));
|
std::unique_ptr<B> b(dynamic_cast<B*>(dynFactory.createInstance("B")));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
fail("unregistered - must throw");
|
fail("unregistered - must throw");
|
||||||
}
|
}
|
||||||
catch (Poco::NotFoundException&)
|
catch (Poco::NotFoundException&)
|
||||||
|
@ -111,11 +111,7 @@ void LoggingFactoryTest::testBuiltins()
|
|||||||
|
|
||||||
void LoggingFactoryTest::testCustom()
|
void LoggingFactoryTest::testCustom()
|
||||||
{
|
{
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<LoggingFactory> fact(new LoggingFactory);
|
|
||||||
#else
|
|
||||||
std::unique_ptr<LoggingFactory> fact(new LoggingFactory);
|
std::unique_ptr<LoggingFactory> fact(new LoggingFactory);
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
|
|
||||||
fact->registerChannelClass("CustomChannel", new Instantiator<CustomChannel, Channel>);
|
fact->registerChannelClass("CustomChannel", new Instantiator<CustomChannel, Channel>);
|
||||||
fact->registerFormatterClass("CustomFormatter", new Instantiator<CustomFormatter, Formatter>);
|
fact->registerFormatterClass("CustomFormatter", new Instantiator<CustomFormatter, Formatter>);
|
||||||
|
@ -47,11 +47,7 @@ int main(int argc, char** argv)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
URI uri(argv[1]);
|
URI uri(argv[1]);
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
std::unique_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
StreamCopier::copyStream(*pStr.get(), std::cout);
|
StreamCopier::copyStream(*pStr.get(), std::cout);
|
||||||
}
|
}
|
||||||
catch (Exception& exc)
|
catch (Exception& exc)
|
||||||
|
@ -76,11 +76,7 @@ void HTTPServerConnection::run()
|
|||||||
response.set("Server", server);
|
response.set("Server", server);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<HTTPRequestHandler> pHandler(_pFactory->createRequestHandler(request));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<HTTPRequestHandler> pHandler(_pFactory->createRequestHandler(request));
|
std::unique_ptr<HTTPRequestHandler> pHandler(_pFactory->createRequestHandler(request));
|
||||||
#endif
|
|
||||||
if (pHandler.get())
|
if (pHandler.get())
|
||||||
{
|
{
|
||||||
if (request.getExpectContinue() && response.getStatus() == HTTPResponse::HTTP_OK)
|
if (request.getExpectContinue() && response.getStatus() == HTTPResponse::HTTP_OK)
|
||||||
|
@ -108,11 +108,7 @@ void TCPServerDispatcher::run()
|
|||||||
TCPConnectionNotification* pCNf = dynamic_cast<TCPConnectionNotification*>(pNf.get());
|
TCPConnectionNotification* pCNf = dynamic_cast<TCPConnectionNotification*>(pNf.get());
|
||||||
if (pCNf)
|
if (pCNf)
|
||||||
{
|
{
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<TCPServerConnection> pConnection(_pConnectionFactory->createConnection(pCNf->socket()));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<TCPServerConnection> pConnection(_pConnectionFactory->createConnection(pCNf->socket()));
|
std::unique_ptr<TCPServerConnection> pConnection(_pConnectionFactory->createConnection(pCNf->socket()));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
poco_check_ptr(pConnection.get());
|
poco_check_ptr(pConnection.get());
|
||||||
beginConnection();
|
beginConnection();
|
||||||
pConnection->start();
|
pConnection->start();
|
||||||
|
@ -79,11 +79,7 @@ void FTPStreamFactoryTest::testDownload()
|
|||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
uri.setPath("/test.txt;type=a");
|
uri.setPath("/test.txt;type=a");
|
||||||
FTPStreamFactory sf;
|
FTPStreamFactory sf;
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(sf.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream dataStr;
|
std::ostringstream dataStr;
|
||||||
StreamCopier::copyStream(*pStr.get(), dataStr);
|
StreamCopier::copyStream(*pStr.get(), dataStr);
|
||||||
|
|
||||||
@ -120,11 +116,7 @@ void FTPStreamFactoryTest::testList()
|
|||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
uri.setPath("/usr/guest/data;type=d");
|
uri.setPath("/usr/guest/data;type=d");
|
||||||
FTPStreamFactory sf;
|
FTPStreamFactory sf;
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(sf.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
|
|
||||||
std::ostringstream dataStr;
|
std::ostringstream dataStr;
|
||||||
StreamCopier::copyStream(*pStr.get(), dataStr);
|
StreamCopier::copyStream(*pStr.get(), dataStr);
|
||||||
@ -162,11 +154,7 @@ void FTPStreamFactoryTest::testUserInfo()
|
|||||||
uri.setPath("/test.txt;type=a");
|
uri.setPath("/test.txt;type=a");
|
||||||
uri.setUserInfo("user:secret");
|
uri.setUserInfo("user:secret");
|
||||||
FTPStreamFactory sf;
|
FTPStreamFactory sf;
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(sf.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
|
|
||||||
std::ostringstream dataStr;
|
std::ostringstream dataStr;
|
||||||
StreamCopier::copyStream(*pStr.get(), dataStr);
|
StreamCopier::copyStream(*pStr.get(), dataStr);
|
||||||
@ -205,11 +193,7 @@ void FTPStreamFactoryTest::testPasswordProvider()
|
|||||||
uri.setPath("/test.txt;type=a");
|
uri.setPath("/test.txt;type=a");
|
||||||
uri.setUserInfo("user");
|
uri.setUserInfo("user");
|
||||||
FTPStreamFactory sf;
|
FTPStreamFactory sf;
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(sf.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
|
|
||||||
std::ostringstream dataStr;
|
std::ostringstream dataStr;
|
||||||
StreamCopier::copyStream(*pStr.get(), dataStr);
|
StreamCopier::copyStream(*pStr.get(), dataStr);
|
||||||
@ -239,11 +223,7 @@ void FTPStreamFactoryTest::testMissingPasswordProvider()
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
FTPStreamFactory sf;
|
FTPStreamFactory sf;
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(sf.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
std::unique_ptr<std::istream> pStr(sf.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
fail("no password provider - must throw");
|
fail("no password provider - must throw");
|
||||||
}
|
}
|
||||||
catch (FTPException&)
|
catch (FTPException&)
|
||||||
|
@ -44,11 +44,7 @@ void HTTPStreamFactoryTest::testNoRedirect()
|
|||||||
HTTPStreamFactory factory;
|
HTTPStreamFactory factory;
|
||||||
URI uri("http://127.0.0.1/large");
|
URI uri("http://127.0.0.1/large");
|
||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPTestServer::LARGE_BODY);
|
assertTrue (ostr.str() == HTTPTestServer::LARGE_BODY);
|
||||||
@ -61,11 +57,7 @@ void HTTPStreamFactoryTest::testEmptyPath()
|
|||||||
HTTPStreamFactory factory;
|
HTTPStreamFactory factory;
|
||||||
URI uri("http://127.0.0.1");
|
URI uri("http://127.0.0.1");
|
||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPTestServer::SMALL_BODY);
|
assertTrue (ostr.str() == HTTPTestServer::SMALL_BODY);
|
||||||
@ -79,11 +71,7 @@ void HTTPStreamFactoryTest::testRedirect()
|
|||||||
opener.registerStreamFactory("http", new HTTPStreamFactory);
|
opener.registerStreamFactory("http", new HTTPStreamFactory);
|
||||||
URI uri("http://127.0.0.1/redirect");
|
URI uri("http://127.0.0.1/redirect");
|
||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(opener.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(opener.open(uri));
|
std::unique_ptr<std::istream> pStr(opener.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPTestServer::LARGE_BODY);
|
assertTrue (ostr.str() == HTTPTestServer::LARGE_BODY);
|
||||||
@ -95,11 +83,7 @@ void HTTPStreamFactoryTest::testProxy()
|
|||||||
HTTPTestServer server;
|
HTTPTestServer server;
|
||||||
HTTPStreamFactory factory("127.0.0.1", server.port());
|
HTTPStreamFactory factory("127.0.0.1", server.port());
|
||||||
URI uri("http://www.somehost.com/large");
|
URI uri("http://www.somehost.com/large");
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPTestServer::LARGE_BODY);
|
assertTrue (ostr.str() == HTTPTestServer::LARGE_BODY);
|
||||||
|
@ -82,11 +82,7 @@ int main(int argc, char** argv)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
URI uri(argv[1]);
|
URI uri(argv[1]);
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
std::unique_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
||||||
#endif
|
|
||||||
StreamCopier::copyStream(*pStr.get(), std::cout);
|
StreamCopier::copyStream(*pStr.get(), std::cout);
|
||||||
}
|
}
|
||||||
catch (Exception& exc)
|
catch (Exception& exc)
|
||||||
|
@ -47,11 +47,7 @@ void HTTPSStreamFactoryTest::testNoRedirect()
|
|||||||
HTTPSStreamFactory factory;
|
HTTPSStreamFactory factory;
|
||||||
URI uri("https://127.0.0.1/large");
|
URI uri("https://127.0.0.1/large");
|
||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
assertTrue (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
||||||
@ -64,11 +60,7 @@ void HTTPSStreamFactoryTest::testEmptyPath()
|
|||||||
HTTPSStreamFactory factory;
|
HTTPSStreamFactory factory;
|
||||||
URI uri("https://127.0.0.1");
|
URI uri("https://127.0.0.1");
|
||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPSTestServer::SMALL_BODY);
|
assertTrue (ostr.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
@ -81,11 +73,7 @@ void HTTPSStreamFactoryTest::testRedirect()
|
|||||||
HTTPSStreamFactory factory;
|
HTTPSStreamFactory factory;
|
||||||
URI uri("https://127.0.0.1/redirect");
|
URI uri("https://127.0.0.1/redirect");
|
||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
assertTrue (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
||||||
@ -100,11 +88,7 @@ void HTTPSStreamFactoryTest::testProxy()
|
|||||||
Application::instance().config().getInt("testsuite.proxy.port")
|
Application::instance().config().getInt("testsuite.proxy.port")
|
||||||
);
|
);
|
||||||
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
|
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str().length() > 0);
|
assertTrue (ostr.str().length() > 0);
|
||||||
|
@ -49,11 +49,7 @@ namespace
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
WebSocket ws(request, response);
|
WebSocket ws(request, response);
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<char> pBuffer(new char[_bufSize]);
|
|
||||||
#else
|
|
||||||
std::unique_ptr<char[]> pBuffer(new char[_bufSize]);
|
std::unique_ptr<char[]> pBuffer(new char[_bufSize]);
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
int flags;
|
int flags;
|
||||||
int n;
|
int n;
|
||||||
do
|
do
|
||||||
|
@ -79,11 +79,7 @@ int main(int argc, char** argv)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
URI uri(argv[1]);
|
URI uri(argv[1]);
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
std::unique_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
StreamCopier::copyStream(*pStr.get(), std::cout);
|
StreamCopier::copyStream(*pStr.get(), std::cout);
|
||||||
}
|
}
|
||||||
catch (Exception& exc)
|
catch (Exception& exc)
|
||||||
|
@ -47,11 +47,7 @@ void HTTPSStreamFactoryTest::testNoRedirect()
|
|||||||
HTTPSStreamFactory factory;
|
HTTPSStreamFactory factory;
|
||||||
URI uri("https://127.0.0.1/large");
|
URI uri("https://127.0.0.1/large");
|
||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
assertTrue (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
||||||
@ -64,11 +60,7 @@ void HTTPSStreamFactoryTest::testEmptyPath()
|
|||||||
HTTPSStreamFactory factory;
|
HTTPSStreamFactory factory;
|
||||||
URI uri("https://127.0.0.1");
|
URI uri("https://127.0.0.1");
|
||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPSTestServer::SMALL_BODY);
|
assertTrue (ostr.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
@ -81,11 +73,7 @@ void HTTPSStreamFactoryTest::testRedirect()
|
|||||||
HTTPSStreamFactory factory;
|
HTTPSStreamFactory factory;
|
||||||
URI uri("https://127.0.0.1/redirect");
|
URI uri("https://127.0.0.1/redirect");
|
||||||
uri.setPort(server.port());
|
uri.setPort(server.port());
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
assertTrue (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
||||||
@ -100,11 +88,7 @@ void HTTPSStreamFactoryTest::testProxy()
|
|||||||
Application::instance().config().getInt("testsuite.proxy.port")
|
Application::instance().config().getInt("testsuite.proxy.port")
|
||||||
);
|
);
|
||||||
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
|
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assertTrue (ostr.str().length() > 0);
|
assertTrue (ostr.str().length() > 0);
|
||||||
|
@ -295,11 +295,7 @@ protected:
|
|||||||
p.setBaseName(clazz);
|
p.setBaseName(clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<CodeWriter> pCodeWriter(createCodeWriter(page, clazz));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<CodeWriter> pCodeWriter(createCodeWriter(page, clazz));
|
std::unique_ptr<CodeWriter> pCodeWriter(createCodeWriter(page, clazz));
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!_outputDir.empty())
|
if (!_outputDir.empty())
|
||||||
{
|
{
|
||||||
|
@ -303,11 +303,7 @@ protected:
|
|||||||
void parse(const std::string& file)
|
void parse(const std::string& file)
|
||||||
{
|
{
|
||||||
logger().information("Preprocessing " + file);
|
logger().information("Preprocessing " + file);
|
||||||
#ifndef POCO_ENABLE_CPP11
|
|
||||||
std::auto_ptr<Preprocessor> pPreProc(preprocess(file));
|
|
||||||
#else
|
|
||||||
std::unique_ptr<Preprocessor> pPreProc(preprocess(file));
|
std::unique_ptr<Preprocessor> pPreProc(preprocess(file));
|
||||||
#endif // POCO_ENABLE_CPP11
|
|
||||||
logger().information("Parsing " + file);
|
logger().information("Parsing " + file);
|
||||||
if (pPreProc->stream().good())
|
if (pPreProc->stream().good())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user