Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
[dcpomatic.git] / src / tools / dcpomatic_cli.cc
index 31681a7fca7c7e9341f89b0cba2dd7ee041e7dad..788594f0ca6273b509ee3641e13f0d25dbb70808 100644 (file)
@@ -121,7 +121,7 @@ list_servers ()
 {
        while (true) {
                int N = 0;
-               list<EncodeServerDescription> servers = EncodeServerFinder::instance()->servers ();
+               list<EncodeServerDescription> servers = EncodeServerFinder::instance()->servers();
 
                /* This is a bit fiddly because we want to list configured servers that are down as well
                   as all those (configured and found by broadcast) that are up.
@@ -144,7 +144,7 @@ list_servers ()
                                optional<int> threads;
                                list<EncodeServerDescription>::iterator j = servers.begin ();
                                while (j != servers.end ()) {
-                                       if (i == j->host_name()) {
+                                       if (i == j->host_name() && j->current_link_version()) {
                                                threads = j->threads();
                                                list<EncodeServerDescription>::iterator tmp = j;
                                                ++tmp;
@@ -164,7 +164,11 @@ list_servers ()
 
                        /* Now report any left that have been found by broadcast */
                        BOOST_FOREACH (EncodeServerDescription const & i, servers) {
-                               cout << std::left << setw(24) << i.host_name() << " UP     " << i.threads() << "\n";
+                               if (i.current_link_version()) {
+                                       cout << std::left << setw(24) << i.host_name() << " UP     " << i.threads() << "\n";
+                               } else {
+                                       cout << std::left << setw(24) << i.host_name() << " bad version\n";
+                               }
                                ++N;
                        }
                }