Commit f5787584 by 李维杰

调整请求

parent da2ae639
......@@ -99,7 +99,16 @@ namespace offcn
}
else
{
client_lists_.insert(std::pair<std::string, std::string>(from_id, "null"));
if (client_lists_.size() == 0)
{
client_lists_.insert(std::pair<std::string, std::string>(from_id, "rtmp"));
}
else
{
client_lists_.insert(std::pair<std::string, std::string>(from_id, "null"));
}
//response
response = MqttRequest::BuildResponse(message_id, "ok");
mqtt_wrapper_->SendRequest(from_id, response);
......@@ -107,6 +116,11 @@ namespace offcn
std::map<std::string, std::string>::iterator itor;
for (itor = client_lists_.begin(); itor != client_lists_.end(); itor++)
{
if (itor->first.compare(from_id) != 0 && itor->second.compare("rtmp") == 0)
{
response = MqttRequest::PublishersRequest("sdf", from_id, itor->first);
mqtt_wrapper_->SendRequest(from_id, response);
}
printf("id = %s, pull type = %s\n", itor->first.c_str(), itor->second.c_str());
}
printf("------------------------------------\n");
......
......@@ -205,6 +205,7 @@ namespace offcn
Json::Value root;
Json::StreamWriterBuilder wBuilder;
root["method"] = "response";
root["message_id"] = message_id;
root["result_code"] = result_code;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment