Skip to content

Commit ea298d6

Browse files
authored
allow topic searches to continue past invalid multi-type topics. (#146)
1 parent eb9af5f commit ea298d6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/image_streamer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ void ImageTransportImageStreamer::start()
3838
inactive_ = true;
3939
for (auto topic_and_types : tnat) {
4040
if (topic_and_types.second.size() > 1) {
41-
// explicitly avoid topics with more than one type
42-
break;
41+
// skip over topics with more than one type
42+
continue;
4343
}
4444
auto & topic_name = topic_and_types.first;
4545
if(topic_name == topic_ || (topic_name.find("/") == 0 && topic_name.substr(1) == topic_)){

src/web_video_server.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ bool WebVideoServer::handle_stream(const async_web_server_cpp::HttpRequest &requ
192192
bool did_find_compressed_topic = false;
193193
for (auto topic_and_types : tnat) {
194194
if (topic_and_types.second.size() > 1) {
195-
// explicitly avoid topics with more than one type
196-
break;
195+
// skip over topics with more than one type
196+
continue;
197197
}
198198
auto & topic_name = topic_and_types.first;
199199
if(topic_name == compressed_topic_name || (topic_name.find("/") == 0 && topic_name.substr(1) == compressed_topic_name)){
@@ -249,8 +249,8 @@ bool WebVideoServer::handle_stream_viewer(const async_web_server_cpp::HttpReques
249249
bool did_find_compressed_topic = false;
250250
for (auto topic_and_types : tnat) {
251251
if (topic_and_types.second.size() > 1) {
252-
// explicitly avoid topics with more than one type
253-
break;
252+
// skip over topics with more than one type
253+
continue;
254254
}
255255
auto & topic_name = topic_and_types.first;
256256
if(topic_name == compressed_topic_name || (topic_name.find("/") == 0 && topic_name.substr(1) == compressed_topic_name)){
@@ -292,8 +292,8 @@ bool WebVideoServer::handle_list_streams(const async_web_server_cpp::HttpRequest
292292
auto tnat = nh_->get_topic_names_and_types();
293293
for (auto topic_and_types : tnat) {
294294
if (topic_and_types.second.size() > 1) {
295-
// explicitly avoid topics with more than one type
296-
break;
295+
// skip over topics with more than one type
296+
continue;
297297
}
298298
auto & topic_name = topic_and_types.first;
299299
auto & topic_type = topic_and_types.second[0]; // explicitly take the first

0 commit comments

Comments
 (0)