Skip to content

Commit 976a735

Browse files
committed
Master fixed the process message filter for query:get
1 parent 1ed72aa commit 976a735

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/master/GoProMaster.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,10 @@ void GoProMaster::processMessage(const std::string& server, const std::string& m
694694
std::cerr << "query:get, return value should be array" << std::endl;
695695
return;
696696
}
697+
if(key == "query:get" && data["value"]["data"].size() == 0){
698+
std::cout << "Camera response null state from server: " << server << std::endl;
699+
return;
700+
}
697701
/**
698702
* In case you're confuse here...
699703
* The data is like this
@@ -722,6 +726,9 @@ void GoProMaster::processMessage(const std::string& server, const std::string& m
722726
continue;
723727
}
724728
std::string ip_ref = ip.value()["ip"].get<std::string>();
729+
if(ip_ref.size() == 0){
730+
continue;
731+
}
725732
int32_t found = findCamera(server, ip_ref);
726733
CameraInfo _cam;
727734
if(found == -1){

src/server/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ void MediaAction(const WebSocketChannelPtr& channel, json j){
383383
}
384384
}
385385

386-
387386
void PreviewAction(const WebSocketChannelPtr& channel, json j){
388387
std::string target = "";
389388
std::string name = "";

0 commit comments

Comments
 (0)