ported 1.4.4 branch changes (needs build checks and test runs!)

This commit is contained in:
Aleksandar Fabijanic
2012-05-19 03:04:51 +00:00
parent e5e3a57baf
commit 9b952a29c7
62 changed files with 1361 additions and 135 deletions

View File

@@ -42,6 +42,7 @@
#include "Poco/Net/Net.h"
#include "Poco/SharedPtr.h"
#include "Poco/BasicEvent.h"
namespace Poco {
@@ -72,9 +73,15 @@ public:
///
/// Creates a new request handler for the given HTTP request.
protected:
Poco::BasicEvent<const bool> serverStopped;
private:
HTTPRequestHandlerFactory(const HTTPRequestHandlerFactory&);
HTTPRequestHandlerFactory& operator = (const HTTPRequestHandlerFactory&);
friend class HTTPServer;
friend class HTTPServerConnection;
};

View File

@@ -85,6 +85,19 @@ public:
~HTTPServer();
/// Destroys the HTTPServer and its HTTPRequestHandlerFactory.
void stopAll(bool abortCurrent = false);
/// Stops the server. In contrast to TCPServer::stop(), which also
/// stops the server, but allows all client connections to finish at
/// their pace, this allows finer control over client connections.
///
/// If abortCurrent is false, all current requests are allowed to
/// complete. If abortCurrent is false, the underlying sockets of
/// all client connections are shut down, causing all requests
/// to abort.
private:
HTTPRequestHandlerFactory::Ptr _pFactory;
};

View File

@@ -45,6 +45,7 @@
#include "Poco/Net/HTTPResponse.h"
#include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPServerParams.h"
#include "Poco/Mutex.h"
namespace Poco {
@@ -70,10 +71,13 @@ public:
protected:
void sendErrorResponse(HTTPServerSession& session, HTTPResponse::HTTPStatus status);
void onServerStopped(const bool& abortCurrent);
private:
HTTPServerParams::Ptr _pParams;
HTTPRequestHandlerFactory::Ptr _pFactory;
bool _stopped;
Poco::FastMutex _mutex;
};