mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
HTTPServer::stopAll(): close the socket instead of just shutting it down, as the latter won't wake up a select() on Windows
This commit is contained in:
parent
378077f209
commit
d9dd2a81bd
@ -1,18 +1,18 @@
|
|||||||
This is the changelog file for the POCO C++ Libraries.
|
This is the changelog file for the POCO C++ Libraries.
|
||||||
|
|
||||||
|
|
||||||
Release 1.5.0 (2012-07-04)
|
Release 1.5.0 (2012-07-30)
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
- added JSON
|
- added JSON
|
||||||
- added Util::JSONConfiguration
|
- added Util::JSONConfiguration
|
||||||
- added PDF
|
- added PDF
|
||||||
- added PRoGen
|
- added FIFOBuffer and FIFOBufferStream
|
||||||
- added FIFOBuffer
|
|
||||||
- fixed SF# 3522906: Unregistering handlers from SocketReactor
|
- fixed SF# 3522906: Unregistering handlers from SocketReactor
|
||||||
- fixed SF# 3522084: AbstractConfiguration does not support 64-bit integers
|
- fixed SF# 3522084: AbstractConfiguration does not support 64-bit integers
|
||||||
|
- HTTPServer::stopAll(): close the socket instead of just shutting it down, as the latter won't wake up a select() on Windows
|
||||||
|
|
||||||
Release 1.4.4 (2012-04-??)
|
Release 1.4.4 (2012-07-??)
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
- ZipStream now builds correctly in unbundled build.
|
- ZipStream now builds correctly in unbundled build.
|
||||||
|
@ -78,34 +78,36 @@ void HTTPServerConnection::run()
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Poco::FastMutex::ScopedLock lock(_mutex);
|
Poco::FastMutex::ScopedLock lock(_mutex);
|
||||||
|
if (!_stopped)
|
||||||
HTTPServerResponseImpl response(session);
|
|
||||||
HTTPServerRequestImpl request(response, session, _pParams);
|
|
||||||
|
|
||||||
Poco::Timestamp now;
|
|
||||||
response.setDate(now);
|
|
||||||
response.setVersion(request.getVersion());
|
|
||||||
response.setKeepAlive(_pParams->getKeepAlive() && request.getKeepAlive() && session.canKeepAlive());
|
|
||||||
if (!server.empty())
|
|
||||||
response.set("Server", server);
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
std::auto_ptr<HTTPRequestHandler> pHandler(_pFactory->createRequestHandler(request));
|
HTTPServerResponseImpl response(session);
|
||||||
if (pHandler.get())
|
HTTPServerRequestImpl request(response, session, _pParams);
|
||||||
|
|
||||||
|
Poco::Timestamp now;
|
||||||
|
response.setDate(now);
|
||||||
|
response.setVersion(request.getVersion());
|
||||||
|
response.setKeepAlive(_pParams->getKeepAlive() && request.getKeepAlive() && session.canKeepAlive());
|
||||||
|
if (!server.empty())
|
||||||
|
response.set("Server", server);
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (request.expectContinue())
|
std::auto_ptr<HTTPRequestHandler> pHandler(_pFactory->createRequestHandler(request));
|
||||||
response.sendContinue();
|
if (pHandler.get())
|
||||||
|
{
|
||||||
|
if (request.expectContinue())
|
||||||
|
response.sendContinue();
|
||||||
|
|
||||||
pHandler->handleRequest(request, response);
|
pHandler->handleRequest(request, response);
|
||||||
session.setKeepAlive(_pParams->getKeepAlive() && response.getKeepAlive() && session.canKeepAlive());
|
session.setKeepAlive(_pParams->getKeepAlive() && response.getKeepAlive() && session.canKeepAlive());
|
||||||
|
}
|
||||||
|
else sendErrorResponse(session, HTTPResponse::HTTP_NOT_IMPLEMENTED);
|
||||||
|
}
|
||||||
|
catch (Poco::Exception&)
|
||||||
|
{
|
||||||
|
if (!response.sent())
|
||||||
|
sendErrorResponse(session, HTTPResponse::HTTP_INTERNAL_SERVER_ERROR);
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
else sendErrorResponse(session, HTTPResponse::HTTP_NOT_IMPLEMENTED);
|
|
||||||
}
|
|
||||||
catch (Poco::Exception&)
|
|
||||||
{
|
|
||||||
if (!response.sent())
|
|
||||||
sendErrorResponse(session, HTTPResponse::HTTP_INTERNAL_SERVER_ERROR);
|
|
||||||
throw;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NoMessageException&)
|
catch (NoMessageException&)
|
||||||
@ -138,7 +140,7 @@ void HTTPServerConnection::onServerStopped(const bool& abortCurrent)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
socket().shutdown();
|
socket().close();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -150,7 +152,7 @@ void HTTPServerConnection::onServerStopped(const bool& abortCurrent)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
socket().shutdown();
|
socket().close();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user