mirror of https://github.com/Icinga/icinga2.git
parent
00712f1902
commit
7e4953dd35
|
@ -71,9 +71,12 @@ Value ApiListener::ConfigUpdateObjectAPIHandler(const MessageOrigin::Ptr& origin
|
||||||
if (!listener)
|
if (!listener)
|
||||||
return Empty;
|
return Empty;
|
||||||
|
|
||||||
|
String objType = params->Get("type");
|
||||||
|
String objName = params->Get("name");
|
||||||
|
|
||||||
if (!listener->GetAcceptConfig()) {
|
if (!listener->GetAcceptConfig()) {
|
||||||
Log(LogWarning, "ApiListener")
|
Log(LogWarning, "ApiListener")
|
||||||
<< "Ignoring config update. '" << listener->GetName() << "' does not accept config.";
|
<< "Ignoring config update for object '" << objName << "' of type '" << objType << "'. '" << listener->GetName() << "' does not accept config.";
|
||||||
return Empty;
|
return Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +102,6 @@ Value ApiListener::ConfigUpdateObjectAPIHandler(const MessageOrigin::Ptr& origin
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update the object */
|
/* update the object */
|
||||||
String objType = params->Get("type");
|
|
||||||
String objName = params->Get("name");
|
|
||||||
int objVersion = Convert::ToLong(params->Get("version"));
|
int objVersion = Convert::ToLong(params->Get("version"));
|
||||||
|
|
||||||
ConfigType::Ptr dtype = ConfigType::GetByName(objType);
|
ConfigType::Ptr dtype = ConfigType::GetByName(objType);
|
||||||
|
|
|
@ -367,7 +367,7 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctype == ClientJsonRpc) {
|
if (ctype == ClientJsonRpc) {
|
||||||
Log(LogInformation, "ApiListener", "New JSON-RPC client");
|
Log(LogNotice, "ApiListener", "New JSON-RPC client");
|
||||||
|
|
||||||
JsonRpcConnection::Ptr aclient = new JsonRpcConnection(identity, verify_ok, tlsStream, role);
|
JsonRpcConnection::Ptr aclient = new JsonRpcConnection(identity, verify_ok, tlsStream, role);
|
||||||
aclient->Start();
|
aclient->Start();
|
||||||
|
@ -392,7 +392,7 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
|
||||||
} else
|
} else
|
||||||
AddAnonymousClient(aclient);
|
AddAnonymousClient(aclient);
|
||||||
} else {
|
} else {
|
||||||
Log(LogInformation, "ApiListener", "New HTTP client");
|
Log(LogNotice, "ApiListener", "New HTTP client");
|
||||||
|
|
||||||
HttpServerConnection::Ptr aclient = new HttpServerConnection(identity, verify_ok, tlsStream);
|
HttpServerConnection::Ptr aclient = new HttpServerConnection(identity, verify_ok, tlsStream);
|
||||||
aclient->Start();
|
aclient->Start();
|
||||||
|
|
|
@ -115,8 +115,6 @@ bool HttpServerConnection::ProcessMessage(void)
|
||||||
|
|
||||||
void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
|
void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
|
||||||
{
|
{
|
||||||
Log(LogInformation, "HttpServerConnection", "Processing Http message");
|
|
||||||
|
|
||||||
String auth_header = request.Headers->Get("authorization");
|
String auth_header = request.Headers->Get("authorization");
|
||||||
|
|
||||||
String::SizeType pos = auth_header.FindFirstOf(" ");
|
String::SizeType pos = auth_header.FindFirstOf(" ");
|
||||||
|
@ -145,6 +143,10 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
|
||||||
user.reset();
|
user.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log(LogInformation, "HttpServerConnection")
|
||||||
|
<< "Request: " << request.RequestMethod << " " << request.RequestUrl->Format()
|
||||||
|
<< " (" << (user ? user->GetName() : "<unauthenticated>") << ")";
|
||||||
|
|
||||||
HttpResponse response(m_Stream, request);
|
HttpResponse response(m_Stream, request);
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
|
Loading…
Reference in New Issue