mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Rename HttpRequest.Url to HttpRequest.RequestUrl
Otherwise gcc will break with the Url class, clang works. refs #9447
This commit is contained in:
parent
8bf949852a
commit
269e79647f
@ -51,7 +51,7 @@ StreamReadStatus HttpChunkedEncoding::ReadChunkFromStream(const Stream::Ptr& str
|
|||||||
scontext.MustRead = false;
|
scontext.MustRead = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scontext.Size < context.LengthIndicator) {
|
if (scontext.Size < (size_t)context.LengthIndicator) {
|
||||||
scontext.MustRead = true;
|
scontext.MustRead = true;
|
||||||
return StatusNeedData;
|
return StatusNeedData;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ void HttpHandler::ProcessRequest(const ApiUser::Ptr& user, HttpRequest& request,
|
|||||||
HttpHandler::Ptr current_handler, handler;
|
HttpHandler::Ptr current_handler, handler;
|
||||||
bool exact_match = true;
|
bool exact_match = true;
|
||||||
|
|
||||||
BOOST_FOREACH(const String& elem, request.Url->GetPath()) {
|
BOOST_FOREACH(const String& elem, request.RequestUrl->GetPath()) {
|
||||||
current_handler = node->Get("handler");
|
current_handler = node->Get("handler");
|
||||||
if (current_handler)
|
if (current_handler)
|
||||||
handler = current_handler;
|
handler = current_handler;
|
||||||
@ -86,7 +86,7 @@ void HttpHandler::ProcessRequest(const ApiUser::Ptr& user, HttpRequest& request,
|
|||||||
handler = current_handler;
|
handler = current_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!handler || (!exact_match && !handler->CanAlsoHandleUrl(request.Url))) {
|
if (!handler || (!exact_match && !handler->CanAlsoHandleUrl(request.RequestUrl))) {
|
||||||
response.SetStatus(404, "Not found");
|
response.SetStatus(404, "Not found");
|
||||||
String msg = "<h1>Not found</h1>";
|
String msg = "<h1>Not found</h1>";
|
||||||
response.WriteBody(msg.CStr(), msg.GetLength());
|
response.WriteBody(msg.CStr(), msg.GetLength());
|
||||||
|
@ -56,7 +56,7 @@ bool HttpRequest::Parse(const Stream::Ptr& stream, StreamReadContext& src, bool
|
|||||||
if (tokens.size() != 3)
|
if (tokens.size() != 3)
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid HTTP request"));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid HTTP request"));
|
||||||
RequestMethod = tokens[0];
|
RequestMethod = tokens[0];
|
||||||
Url = new class Url(tokens[1]);
|
RequestUrl = new class Url(tokens[1]);
|
||||||
|
|
||||||
if (tokens[2] == "HTTP/1.0")
|
if (tokens[2] == "HTTP/1.0")
|
||||||
ProtocolVersion = HttpVersion10;
|
ProtocolVersion = HttpVersion10;
|
||||||
@ -67,7 +67,7 @@ bool HttpRequest::Parse(const Stream::Ptr& stream, StreamReadContext& src, bool
|
|||||||
|
|
||||||
m_State = HttpRequestHeaders;
|
m_State = HttpRequestHeaders;
|
||||||
Log(LogWarning, "HttpRequest")
|
Log(LogWarning, "HttpRequest")
|
||||||
<< "Method: " << RequestMethod << ", Url: " << Url;
|
<< "Method: " << RequestMethod << ", Url: " << RequestUrl;
|
||||||
} else if (m_State == HttpRequestHeaders) {
|
} else if (m_State == HttpRequestHeaders) {
|
||||||
if (line == "") {
|
if (line == "") {
|
||||||
m_State = HttpRequestBody;
|
m_State = HttpRequestBody;
|
||||||
|
@ -54,7 +54,7 @@ public:
|
|||||||
bool Complete;
|
bool Complete;
|
||||||
|
|
||||||
String RequestMethod;
|
String RequestMethod;
|
||||||
Url::Ptr Url;
|
Url::Ptr RequestUrl;
|
||||||
HttpVersion ProtocolVersion;
|
HttpVersion ProtocolVersion;
|
||||||
|
|
||||||
Dictionary::Ptr Headers;
|
Dictionary::Ptr Headers;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user