mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
finally get rid of std::auto_ptr
This commit is contained in:
@@ -50,7 +50,7 @@ public:
|
||||
{
|
||||
Poco::Net::initializeSSL();
|
||||
}
|
||||
|
||||
|
||||
~SSLInitializer()
|
||||
{
|
||||
Poco::Net::uninitializeSSL();
|
||||
@@ -64,7 +64,7 @@ int main(int argc, char** argv)
|
||||
HTTPStreamFactory::registerFactory();
|
||||
HTTPSStreamFactory::registerFactory();
|
||||
FTPStreamFactory::registerFactory();
|
||||
|
||||
|
||||
if (argc != 2)
|
||||
{
|
||||
Path p(argv[0]);
|
||||
@@ -74,7 +74,7 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Note: we must create the passphrase handler prior Context
|
||||
// Note: we must create the passphrase handler prior Context
|
||||
SharedPtr<InvalidCertificateHandler> ptrCert = new ConsoleCertificateHandler(false); // ask the user via console
|
||||
Context::Ptr ptrContext = new Context(Context::CLIENT_USE, "", "", "rootcert.pem", Context::VERIFY_RELAXED, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||
SSLManager::instance().initializeClient(0, ptrCert, ptrContext);
|
||||
@@ -82,11 +82,7 @@ int main(int argc, char** argv)
|
||||
try
|
||||
{
|
||||
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));
|
||||
#endif
|
||||
StreamCopier::copyStream(*pStr.get(), std::cout);
|
||||
}
|
||||
catch (Exception& exc)
|
||||
@@ -94,6 +90,6 @@ int main(int argc, char** argv)
|
||||
std::cerr << exc.displayText() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user