mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 00:49:46 +02:00
integrated changes from main repository
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPRequest.cpp
|
||||
//
|
||||
// $Id: //poco/1.3/Net/src/HTTPRequest.cpp#1 $
|
||||
// $Id: //poco/1.3/Net/src/HTTPRequest.cpp#2 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTP
|
||||
@@ -211,10 +211,10 @@ void HTTPRequest::read(std::istream& istr)
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
if (ch == eof) throw MessageException("No HTTP request header");
|
||||
while (!isspace(ch) && ch != eof && method.length() < MAX_METHOD_LENGTH) { method += (char) ch; ch = istr.get(); }
|
||||
if (!isspace(ch)) throw MessageException("HTTP request method too long");
|
||||
if (!isspace(ch)) throw MessageException("HTTP request method invalid or too long");
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
while (!isspace(ch) && ch != eof && uri.length() < MAX_URI_LENGTH) { uri += (char) ch; ch = istr.get(); }
|
||||
if (!isspace(ch)) throw MessageException("HTTP request URI too long");
|
||||
if (!isspace(ch)) throw MessageException("HTTP request URI invalid or too long");
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
while (!isspace(ch) && ch != eof && version.length() < MAX_VERSION_LENGTH) { version += (char) ch; ch = istr.get(); }
|
||||
if (!isspace(ch)) throw MessageException("Invalid HTTP version string");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPServerSession.cpp
|
||||
//
|
||||
// $Id: //poco/1.3/Net/src/HTTPServerSession.cpp#1 $
|
||||
// $Id: //poco/1.3/Net/src/HTTPServerSession.cpp#2 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTPServer
|
||||
@@ -64,9 +64,10 @@ bool HTTPServerSession::hasMoreRequests()
|
||||
--_maxKeepAliveRequests;
|
||||
return socket().poll(getTimeout(), Socket::SELECT_READ);
|
||||
}
|
||||
else if (_maxKeepAliveRequests > 0 && getKeepAlive())
|
||||
else if (_maxKeepAliveRequests != 0 && getKeepAlive())
|
||||
{
|
||||
--_maxKeepAliveRequests;
|
||||
if (_maxKeepAliveRequests > 0)
|
||||
--_maxKeepAliveRequests;
|
||||
return socket().poll(_keepAliveTimeout, Socket::SELECT_READ);
|
||||
}
|
||||
else return false;
|
||||
|
||||
Reference in New Issue
Block a user