fixed GH# 251: HTTPStreamFactory::unregisterFactory missing implementation?

This commit is contained in:
Guenter Obiltschnig 2013-08-02 18:07:36 +02:00
parent 915265f2cb
commit 981b0a1ae4
5 changed files with 27 additions and 2 deletions

View File

@ -121,6 +121,10 @@ public:
/// Registers the FTPStreamFactory with the
/// default URIStreamOpener instance.
static void unregisterFactory();
/// Unregisters the FTPStreamFactory with the
/// default URIStreamOpener instance.
protected:
static void splitUserInfo(const std::string& userInfo, std::string& username, std::string& password);
static void getUserInfo(const Poco::URI& uri, std::string& username, std::string& password);

View File

@ -254,4 +254,10 @@ void FTPStreamFactory::registerFactory()
}
void FTPStreamFactory::unregisterFactory()
{
URIStreamOpener::defaultOpener().unregisterStreamFactory("ftp");
}
} } // namespace Poco::Net

View File

@ -180,4 +180,10 @@ void HTTPStreamFactory::registerFactory()
}
void HTTPStreamFactory::unregisterFactory()
{
URIStreamOpener::defaultOpener().unregisterStreamFactory("http");
}
} } // namespace Poco::Net

View File

@ -81,6 +81,10 @@ public:
static void registerFactory();
/// Registers the HTTPSStreamFactory with the
/// default URIStreamOpener instance.
static void unregisterFactory();
/// Unregisters the HTTPSStreamFactory with the
/// default URIStreamOpener instance.
private:
enum

View File

@ -181,8 +181,13 @@ std::istream* HTTPSStreamFactory::open(const URI& uri)
void HTTPSStreamFactory::registerFactory()
{
std::string https("https");
URIStreamOpener::defaultOpener().registerStreamFactory(https, new HTTPSStreamFactory);
URIStreamOpener::defaultOpener().registerStreamFactory("https", new HTTPSStreamFactory);
}
void HTTPSStreamFactory::unregisterFactory()
{
URIStreamOpener::defaultOpener().unregisterStreamFactory("https");
}