本文整理汇总了C++中llhttpnode::ResponsePtr::status方法的典型用法代码示例。如果您正苦于以下问题:C++ ResponsePtr::status方法的具体用法?C++ ResponsePtr::status怎么用?C++ ResponsePtr::status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llhttpnode::ResponsePtr
的用法示例。
在下文中一共展示了ResponsePtr::status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: post
void LLTrustedMessageService::post(LLHTTPNode::ResponsePtr response,
const LLSD& context,
const LLSD& input) const
{
std::string name = context["request"]["wildcard"]["message-name"];
std::string senderIP = context["request"]["remote-host"];
std::string senderPort = context["request"]["headers"]
["x-GIS-udp-listen-port"];
LLSD message_data;
std::string sender = senderIP + ":" + senderPort;
message_data["sender"] = sender;
message_data["body"] = input;
// untrusted senders should not have access to the trusted message
// service, but this can happen in development, so check and warn
LLMessageConfig::SenderTrust trust =
LLMessageConfig::getSenderTrustedness(name);
if ((trust == LLMessageConfig::TRUSTED ||
(trust == LLMessageConfig::NOT_SET &&
gMessageSystem->isTrustedMessage(name)))
&& !gMessageSystem->isTrustedSender(LLHost(sender)))
{
LL_WARNS("Messaging") << "trusted message POST to /trusted-message/"
<< name << " from unknown or untrusted sender "
<< sender << llendl;
response->status(403, "Unknown or untrusted sender");
}
else
{
gMessageSystem->receivedMessageFromTrustedSender();
if (input.has("binary-template-data"))
{
llinfos << "Dispatching template: " << input << llendl;
// try and send this message using udp dispatch
LLMessageSystem::dispatchTemplate(name, message_data, response);
}
else
{
llinfos << "Dispatching without template: " << input << llendl;
LLMessageSystem::dispatch(name, message_data, response);
}
}
}