replaced plain pointers with smart pointers in various interfaces

This commit is contained in:
Guenter Obiltschnig
2009-03-24 10:40:58 +00:00
parent 37e6fa383a
commit a790bba33c
16 changed files with 60 additions and 70 deletions

View File

@@ -1,7 +1,7 @@
// //
// HTTPRequestHandlerFactory.h // HTTPRequestHandlerFactory.h
// //
// $Id: //poco/svn/Net/include/Poco/Net/HTTPRequestHandlerFactory.h#2 $ // $Id: //poco/Main/Net/include/Poco/Net/HTTPRequestHandlerFactory.h#4 $
// //
// Library: Net // Library: Net
// Package: HTTPServer // Package: HTTPServer
@@ -41,6 +41,7 @@
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "Poco/SharedPtr.h"
namespace Poco { namespace Poco {
@@ -58,6 +59,8 @@ class Net_API HTTPRequestHandlerFactory
/// method. /// method.
{ {
public: public:
typedef Poco::SharedPtr<HTTPRequestHandlerFactory> Ptr;
HTTPRequestHandlerFactory(); HTTPRequestHandlerFactory();
/// Creates the HTTPRequestHandlerFactory. /// Creates the HTTPRequestHandlerFactory.

View File

@@ -1,7 +1,7 @@
// //
// HTTPServer.h // HTTPServer.h
// //
// $Id: //poco/svn/Net/include/Poco/Net/HTTPServer.h#2 $ // $Id: //poco/Main/Net/include/Poco/Net/HTTPServer.h#3 $
// //
// Library: Net // Library: Net
// Package: HTTPServer // Package: HTTPServer
@@ -42,16 +42,14 @@
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "Poco/Net/TCPServer.h" #include "Poco/Net/TCPServer.h"
#include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPServerParams.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class HTTPRequestHandlerFactory;
class HTTPServerParams;
class Net_API HTTPServer: public TCPServer class Net_API HTTPServer: public TCPServer
/// A subclass of TCPServer that implements a /// A subclass of TCPServer that implements a
/// full-featured multithreaded HTTP server. /// full-featured multithreaded HTTP server.
@@ -75,7 +73,7 @@ class Net_API HTTPServer: public TCPServer
/// information about the HTTP protocol. /// information about the HTTP protocol.
{ {
public: public:
HTTPServer(HTTPRequestHandlerFactory* pFactory, const ServerSocket& socket, HTTPServerParams* pParams); HTTPServer(HTTPRequestHandlerFactory::Ptr pFactory, const ServerSocket& socket, HTTPServerParams::Ptr pParams);
/// Creates the HTTPServer, using the given ServerSocket. /// Creates the HTTPServer, using the given ServerSocket.
/// ///
/// The server takes ownership of the HTTPRequstHandlerFactory /// The server takes ownership of the HTTPRequstHandlerFactory
@@ -85,7 +83,7 @@ public:
/// ///
/// News threads are taken from the default thread pool. /// News threads are taken from the default thread pool.
HTTPServer(HTTPRequestHandlerFactory* pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, HTTPServerParams* pParams); HTTPServer(HTTPRequestHandlerFactory::Ptr pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, HTTPServerParams::Ptr pParams);
/// Creates the HTTPServer, using the given ServerSocket. /// Creates the HTTPServer, using the given ServerSocket.
/// ///
/// The server takes ownership of the HTTPRequstHandlerFactory /// The server takes ownership of the HTTPRequstHandlerFactory

View File

@@ -1,7 +1,7 @@
// //
// HTTPServerConnection.h // HTTPServerConnection.h
// //
// $Id: //poco/svn/Net/include/Poco/Net/HTTPServerConnection.h#2 $ // $Id: //poco/Main/Net/include/Poco/Net/HTTPServerConnection.h#4 $
// //
// Library: Net // Library: Net
// Package: HTTPServer // Package: HTTPServer
@@ -43,14 +43,14 @@
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "Poco/Net/TCPServerConnection.h" #include "Poco/Net/TCPServerConnection.h"
#include "Poco/Net/HTTPResponse.h" #include "Poco/Net/HTTPResponse.h"
#include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPServerParams.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class HTTPServerParams;
class HTTPRequestHandlerFactory;
class HTTPServerSession; class HTTPServerSession;
@@ -59,7 +59,7 @@ class Net_API HTTPServerConnection: public TCPServerConnection
/// connections. /// connections.
{ {
public: public:
HTTPServerConnection(const StreamSocket& socket, HTTPServerParams* pParams, HTTPRequestHandlerFactory* pFactory); HTTPServerConnection(const StreamSocket& socket, HTTPServerParams::Ptr pParams, HTTPRequestHandlerFactory::Ptr pFactory);
/// Creates the HTTPServerConnection. /// Creates the HTTPServerConnection.
virtual ~HTTPServerConnection(); virtual ~HTTPServerConnection();
@@ -72,8 +72,8 @@ protected:
void sendErrorResponse(HTTPServerSession& session, HTTPResponse::HTTPStatus status); void sendErrorResponse(HTTPServerSession& session, HTTPResponse::HTTPStatus status);
private: private:
HTTPServerParams* _pParams; HTTPServerParams::Ptr _pParams;
HTTPRequestHandlerFactory* _pFactory; HTTPRequestHandlerFactory::Ptr _pFactory;
}; };

View File

@@ -1,7 +1,7 @@
// //
// HTTPServerConnectionFactory.h // HTTPServerConnectionFactory.h
// //
// $Id: //poco/svn/Net/include/Poco/Net/HTTPServerConnectionFactory.h#2 $ // $Id: //poco/Main/Net/include/Poco/Net/HTTPServerConnectionFactory.h#3 $
// //
// Library: Net // Library: Net
// Package: HTTPServer // Package: HTTPServer
@@ -42,22 +42,20 @@
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "Poco/Net/TCPServerConnectionFactory.h" #include "Poco/Net/TCPServerConnectionFactory.h"
#include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPServerParams.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class HTTPServerParams;
class HTTPRequestHandlerFactory;
class Net_API HTTPServerConnectionFactory: public TCPServerConnectionFactory class Net_API HTTPServerConnectionFactory: public TCPServerConnectionFactory
/// This implementation of a TCPServerConnectionFactory /// This implementation of a TCPServerConnectionFactory
/// is used by HTTPServer to create HTTPServerConnection objects. /// is used by HTTPServer to create HTTPServerConnection objects.
{ {
public: public:
HTTPServerConnectionFactory(HTTPServerParams* pParams, HTTPRequestHandlerFactory* pFactory); HTTPServerConnectionFactory(HTTPServerParams::Ptr pParams, HTTPRequestHandlerFactory::Ptr pFactory);
/// Creates the HTTPServerConnectionFactory. /// Creates the HTTPServerConnectionFactory.
~HTTPServerConnectionFactory(); ~HTTPServerConnectionFactory();
@@ -68,8 +66,8 @@ public:
/// using the given StreamSocket. /// using the given StreamSocket.
private: private:
HTTPServerParams* _pParams; HTTPServerParams::Ptr _pParams;
HTTPRequestHandlerFactory* _pFactory; HTTPRequestHandlerFactory::Ptr _pFactory;
}; };

View File

@@ -1,7 +1,7 @@
// //
// HTTPServerParams.h // HTTPServerParams.h
// //
// $Id: //poco/svn/Net/include/Poco/Net/HTTPServerParams.h#2 $ // $Id: //poco/Main/Net/include/Poco/Net/HTTPServerParams.h#3 $
// //
// Library: Net // Library: Net
// Package: HTTPServer // Package: HTTPServer
@@ -55,6 +55,8 @@ class Net_API HTTPServerParams: public TCPServerParams
/// Subclasses may add new parameters to the class. /// Subclasses may add new parameters to the class.
{ {
public: public:
typedef Poco::AutoPtr<HTTPServerParams> Ptr;
HTTPServerParams(); HTTPServerParams();
/// Creates the HTTPServerParams. /// Creates the HTTPServerParams.
/// ///

View File

@@ -1,7 +1,7 @@
// //
// NetworkInterface.h // NetworkInterface.h
// //
// $Id: //poco/1.3/Net/include/Poco/Net/NetworkInterface.h#7 $ // $Id: //poco/Main/Net/include/Poco/Net/NetworkInterface.h#5 $
// //
// Library: Net // Library: Net
// Package: Sockets // Package: Sockets

View File

@@ -1,7 +1,7 @@
// //
// TCPServer.h // TCPServer.h
// //
// $Id: //poco/svn/Net/include/Poco/Net/TCPServer.h#2 $ // $Id: //poco/Main/Net/include/Poco/Net/TCPServer.h#4 $
// //
// Library: Net // Library: Net
// Package: TCPServer // Package: TCPServer
@@ -42,6 +42,8 @@
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "Poco/Net/ServerSocket.h" #include "Poco/Net/ServerSocket.h"
#include "Poco/Net/TCPServerConnectionFactory.h"
#include "Poco/Net/TCPServerParams.h"
#include "Poco/Runnable.h" #include "Poco/Runnable.h"
#include "Poco/Thread.h" #include "Poco/Thread.h"
#include "Poco/ThreadPool.h" #include "Poco/ThreadPool.h"
@@ -51,9 +53,7 @@ namespace Poco {
namespace Net { namespace Net {
class TCPServerParams;
class TCPServerDispatcher; class TCPServerDispatcher;
class TCPServerConnectionFactory;
class Net_API TCPServer: public Poco::Runnable class Net_API TCPServer: public Poco::Runnable
@@ -98,7 +98,7 @@ class Net_API TCPServer: public Poco::Runnable
/// Already served connections, however, will continue being served. /// Already served connections, however, will continue being served.
{ {
public: public:
TCPServer(TCPServerConnectionFactory* pFactory, const ServerSocket& socket, TCPServerParams* pParams = 0); TCPServer(TCPServerConnectionFactory::Ptr pFactory, const ServerSocket& socket, TCPServerParams::Ptr pParams = 0);
/// Creates the TCPServer, using the given ServerSocket. /// Creates the TCPServer, using the given ServerSocket.
/// ///
/// The server takes ownership of the TCPServerConnectionFactory /// The server takes ownership of the TCPServerConnectionFactory
@@ -110,7 +110,7 @@ public:
/// ///
/// News threads are taken from the default thread pool. /// News threads are taken from the default thread pool.
TCPServer(TCPServerConnectionFactory* pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, TCPServerParams* pParams = 0); TCPServer(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, TCPServerParams::Ptr pParams = 0);
/// Creates the TCPServer, using the given ServerSocket. /// Creates the TCPServer, using the given ServerSocket.
/// ///
/// The server takes ownership of the TCPServerConnectionFactory /// The server takes ownership of the TCPServerConnectionFactory

View File

@@ -1,7 +1,7 @@
// //
// TCPServerConnectionFactory.h // TCPServerConnectionFactory.h
// //
// $Id: //poco/svn/Net/include/Poco/Net/TCPServerConnectionFactory.h#2 $ // $Id: //poco/Main/Net/include/Poco/Net/TCPServerConnectionFactory.h#3 $
// //
// Library: Net // Library: Net
// Package: TCPServer // Package: TCPServer
@@ -42,6 +42,7 @@
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "Poco/Net/TCPServerConnection.h" #include "Poco/Net/TCPServerConnection.h"
#include "Poco/SharedPtr.h"
namespace Poco { namespace Poco {
@@ -64,6 +65,8 @@ class Net_API TCPServerConnectionFactory
/// of TCPServerConnection. /// of TCPServerConnection.
{ {
public: public:
typedef Poco::SharedPtr<TCPServerConnectionFactory> Ptr;
virtual ~TCPServerConnectionFactory(); virtual ~TCPServerConnectionFactory();
/// Destroys the TCPServerConnectionFactory. /// Destroys the TCPServerConnectionFactory.

View File

@@ -1,7 +1,7 @@
// //
// TCPServerDispatcher.h // TCPServerDispatcher.h
// //
// $Id: //poco/svn/Net/include/Poco/Net/TCPServerDispatcher.h#2 $ // $Id: //poco/Main/Net/include/Poco/Net/TCPServerDispatcher.h#3 $
// //
// Library: Net // Library: Net
// Package: TCPServer // Package: TCPServer
@@ -42,6 +42,8 @@
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "Poco/Net/StreamSocket.h" #include "Poco/Net/StreamSocket.h"
#include "Poco/Net/TCPServerConnectionFactory.h"
#include "Poco/Net/TCPServerParams.h"
#include "Poco/Runnable.h" #include "Poco/Runnable.h"
#include "Poco/NotificationQueue.h" #include "Poco/NotificationQueue.h"
#include "Poco/ThreadPool.h" #include "Poco/ThreadPool.h"
@@ -52,16 +54,12 @@ namespace Poco {
namespace Net { namespace Net {
class TCPServerParams;
class TCPServerConnectionFactory;
class Net_API TCPServerDispatcher: public Poco::Runnable class Net_API TCPServerDispatcher: public Poco::Runnable
/// A helper class for TCPServer that dispatches /// A helper class for TCPServer that dispatches
/// connections to server connection threads. /// connections to server connection threads.
{ {
public: public:
TCPServerDispatcher(TCPServerConnectionFactory* pFactory, Poco::ThreadPool& threadPool, TCPServerParams* pParams); TCPServerDispatcher(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool& threadPool, TCPServerParams::Ptr pParams);
/// Creates the TCPServerDispatcher. /// Creates the TCPServerDispatcher.
/// ///
/// The dispatcher takes ownership of the TCPServerParams object. /// The dispatcher takes ownership of the TCPServerParams object.
@@ -122,17 +120,17 @@ private:
TCPServerDispatcher& operator = (const TCPServerDispatcher&); TCPServerDispatcher& operator = (const TCPServerDispatcher&);
int _rc; int _rc;
TCPServerParams* _pParams; TCPServerParams::Ptr _pParams;
int _currentThreads; int _currentThreads;
int _totalConnections; int _totalConnections;
int _currentConnections; int _currentConnections;
int _maxConcurrentConnections; int _maxConcurrentConnections;
int _refusedConnections; int _refusedConnections;
bool _stopped; bool _stopped;
Poco::NotificationQueue _queue; Poco::NotificationQueue _queue;
TCPServerConnectionFactory* _pConnectionFactory; TCPServerConnectionFactory::Ptr _pConnectionFactory;
Poco::ThreadPool& _threadPool; Poco::ThreadPool& _threadPool;
mutable Poco::FastMutex _mutex; mutable Poco::FastMutex _mutex;
}; };

View File

@@ -1,7 +1,7 @@
// //
// TCPServerParams.h // TCPServerParams.h
// //
// $Id: //poco/svn/Net/include/Poco/Net/TCPServerParams.h#2 $ // $Id: //poco/Main/Net/include/Poco/Net/TCPServerParams.h#4 $
// //
// Library: Net // Library: Net
// Package: TCPServer // Package: TCPServer
@@ -44,6 +44,7 @@
#include "Poco/RefCountedObject.h" #include "Poco/RefCountedObject.h"
#include "Poco/Timespan.h" #include "Poco/Timespan.h"
#include "Poco/Thread.h" #include "Poco/Thread.h"
#include "Poco/AutoPtr.h"
namespace Poco { namespace Poco {
@@ -57,6 +58,8 @@ class Net_API TCPServerParams: public Poco::RefCountedObject
/// Subclasses may add new parameters to the class. /// Subclasses may add new parameters to the class.
{ {
public: public:
typedef Poco::AutoPtr<TCPServerParams> Ptr;
TCPServerParams(); TCPServerParams();
/// Creates the TCPServerParams. /// Creates the TCPServerParams.
/// ///

View File

@@ -1,7 +1,7 @@
// //
// HTTPServer.cpp // HTTPServer.cpp
// //
// $Id: //poco/svn/Net/src/HTTPServer.cpp#2 $ // $Id: //poco/Main/Net/src/HTTPServer.cpp#7 $
// //
// Library: Net // Library: Net
// Package: HTTPServer // Package: HTTPServer
@@ -35,7 +35,6 @@
#include "Poco/Net/HTTPServer.h" #include "Poco/Net/HTTPServer.h"
#include "Poco/Net/HTTPServerParams.h"
#include "Poco/Net/HTTPServerConnectionFactory.h" #include "Poco/Net/HTTPServerConnectionFactory.h"
@@ -43,13 +42,13 @@ namespace Poco {
namespace Net { namespace Net {
HTTPServer::HTTPServer(HTTPRequestHandlerFactory* pFactory, const ServerSocket& socket, HTTPServerParams* pParams): HTTPServer::HTTPServer(HTTPRequestHandlerFactory::Ptr pFactory, const ServerSocket& socket, HTTPServerParams::Ptr pParams):
TCPServer(new HTTPServerConnectionFactory(pParams, pFactory), socket, pParams) TCPServer(new HTTPServerConnectionFactory(pParams, pFactory), socket, pParams)
{ {
} }
HTTPServer::HTTPServer(HTTPRequestHandlerFactory* pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, HTTPServerParams* pParams): HTTPServer::HTTPServer(HTTPRequestHandlerFactory::Ptr pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, HTTPServerParams::Ptr pParams):
TCPServer(new HTTPServerConnectionFactory(pParams, pFactory), threadPool, socket, pParams) TCPServer(new HTTPServerConnectionFactory(pParams, pFactory), threadPool, socket, pParams)
{ {
} }

View File

@@ -1,7 +1,7 @@
// //
// HTTPServerConnection.cpp // HTTPServerConnection.cpp
// //
// $Id: //poco/Main/Net/src/HTTPServerConnection.cpp#11 $ // $Id: //poco/Main/Net/src/HTTPServerConnection.cpp#12 $
// //
// Library: Net // Library: Net
// Package: HTTPServer // Package: HTTPServer
@@ -40,7 +40,6 @@
#include "Poco/Net/HTTPServerResponseImpl.h" #include "Poco/Net/HTTPServerResponseImpl.h"
#include "Poco/Net/HTTPRequestHandler.h" #include "Poco/Net/HTTPRequestHandler.h"
#include "Poco/Net/HTTPRequestHandlerFactory.h" #include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPServerParams.h"
#include "Poco/Net/NetException.h" #include "Poco/Net/NetException.h"
#include "Poco/NumberFormatter.h" #include "Poco/NumberFormatter.h"
#include "Poco/Timestamp.h" #include "Poco/Timestamp.h"
@@ -51,21 +50,17 @@ namespace Poco {
namespace Net { namespace Net {
HTTPServerConnection::HTTPServerConnection(const StreamSocket& socket, HTTPServerParams* pParams, HTTPRequestHandlerFactory* pFactory): HTTPServerConnection::HTTPServerConnection(const StreamSocket& socket, HTTPServerParams::Ptr pParams, HTTPRequestHandlerFactory::Ptr pFactory):
TCPServerConnection(socket), TCPServerConnection(socket),
_pParams(pParams), _pParams(pParams),
_pFactory(pFactory) _pFactory(pFactory)
{ {
poco_check_ptr (pFactory); poco_check_ptr (pFactory);
poco_check_ptr (pParams);
_pParams->duplicate();
} }
HTTPServerConnection::~HTTPServerConnection() HTTPServerConnection::~HTTPServerConnection()
{ {
_pParams->release();
} }

View File

@@ -1,7 +1,7 @@
// //
// HTTPServerConnectionFactory.cpp // HTTPServerConnectionFactory.cpp
// //
// $Id: //poco/svn/Net/src/HTTPServerConnectionFactory.cpp#2 $ // $Id: //poco/Main/Net/src/HTTPServerConnectionFactory.cpp#7 $
// //
// Library: Net // Library: Net
// Package: HTTPServer // Package: HTTPServer
@@ -36,7 +36,6 @@
#include "Poco/Net/HTTPServerConnectionFactory.h" #include "Poco/Net/HTTPServerConnectionFactory.h"
#include "Poco/Net/HTTPServerConnection.h" #include "Poco/Net/HTTPServerConnection.h"
#include "Poco/Net/HTTPServerParams.h"
#include "Poco/Net/HTTPRequestHandlerFactory.h" #include "Poco/Net/HTTPRequestHandlerFactory.h"
@@ -44,21 +43,16 @@ namespace Poco {
namespace Net { namespace Net {
HTTPServerConnectionFactory::HTTPServerConnectionFactory(HTTPServerParams* pParams, HTTPRequestHandlerFactory* pFactory): HTTPServerConnectionFactory::HTTPServerConnectionFactory(HTTPServerParams::Ptr pParams, HTTPRequestHandlerFactory::Ptr pFactory):
_pParams(pParams), _pParams(pParams),
_pFactory(pFactory) _pFactory(pFactory)
{ {
poco_check_ptr (pParams);
poco_check_ptr (pFactory); poco_check_ptr (pFactory);
_pParams->duplicate();
} }
HTTPServerConnectionFactory::~HTTPServerConnectionFactory() HTTPServerConnectionFactory::~HTTPServerConnectionFactory()
{ {
_pParams->release();
delete _pFactory;
} }

View File

@@ -1,7 +1,7 @@
// //
// NetworkInterface.cpp // NetworkInterface.cpp
// //
// $Id: //poco/1.3/Net/src/NetworkInterface.cpp#9 $ // $Id: //poco/Main/Net/src/NetworkInterface.cpp#23 $
// //
// Library: Net // Library: Net
// Package: Sockets // Package: Sockets

View File

@@ -1,7 +1,7 @@
// //
// TCPServer.cpp // TCPServer.cpp
// //
// $Id: //poco/svn/Net/src/TCPServer.cpp#3 $ // $Id: //poco/Main/Net/src/TCPServer.cpp#12 $
// //
// Library: Net // Library: Net
// Package: TCPServer // Package: TCPServer
@@ -50,7 +50,7 @@ namespace Poco {
namespace Net { namespace Net {
TCPServer::TCPServer(TCPServerConnectionFactory* pFactory, const ServerSocket& socket, TCPServerParams* pParams): TCPServer::TCPServer(TCPServerConnectionFactory::Ptr pFactory, const ServerSocket& socket, TCPServerParams::Ptr pParams):
_socket(socket), _socket(socket),
_pDispatcher(new TCPServerDispatcher(pFactory, Poco::ThreadPool::defaultPool(), pParams)), _pDispatcher(new TCPServerDispatcher(pFactory, Poco::ThreadPool::defaultPool(), pParams)),
_thread(threadName(socket)), _thread(threadName(socket)),
@@ -59,7 +59,7 @@ TCPServer::TCPServer(TCPServerConnectionFactory* pFactory, const ServerSocket& s
} }
TCPServer::TCPServer(TCPServerConnectionFactory* pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, TCPServerParams* pParams): TCPServer::TCPServer(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, TCPServerParams::Ptr pParams):
_socket(socket), _socket(socket),
_pDispatcher(new TCPServerDispatcher(pFactory, threadPool, pParams)), _pDispatcher(new TCPServerDispatcher(pFactory, threadPool, pParams)),
_thread(threadName(socket)), _thread(threadName(socket)),

View File

@@ -1,7 +1,7 @@
// //
// TCPServerDispatcher.cpp // TCPServerDispatcher.cpp
// //
// $Id: //poco/svn/Net/src/TCPServerDispatcher.cpp#2 $ // $Id: //poco/Main/Net/src/TCPServerDispatcher.cpp#10 $
// //
// Library: Net // Library: Net
// Package: TCPServer // Package: TCPServer
@@ -36,7 +36,6 @@
#include "Poco/Net/TCPServerDispatcher.h" #include "Poco/Net/TCPServerDispatcher.h"
#include "Poco/Net/TCPServerConnectionFactory.h" #include "Poco/Net/TCPServerConnectionFactory.h"
#include "Poco/Net/TCPServerParams.h"
#include "Poco/Notification.h" #include "Poco/Notification.h"
#include "Poco/AutoPtr.h" #include "Poco/AutoPtr.h"
#include <memory> #include <memory>
@@ -73,7 +72,7 @@ private:
}; };
TCPServerDispatcher::TCPServerDispatcher(TCPServerConnectionFactory* pFactory, Poco::ThreadPool& threadPool, TCPServerParams* pParams): TCPServerDispatcher::TCPServerDispatcher(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool& threadPool, TCPServerParams::Ptr pParams):
_rc(1), _rc(1),
_pParams(pParams), _pParams(pParams),
_currentThreads(0), _currentThreads(0),
@@ -97,8 +96,6 @@ TCPServerDispatcher::TCPServerDispatcher(TCPServerConnectionFactory* pFactory, P
TCPServerDispatcher::~TCPServerDispatcher() TCPServerDispatcher::~TCPServerDispatcher()
{ {
_pParams->release();
delete _pConnectionFactory;
} }