=== Slim/Web/Cometd/Manager.pm ================================================================== --- Slim/Web/Cometd/Manager.pm (revision 40984) +++ Slim/Web/Cometd/Manager.pm (local) @@ -63,6 +63,12 @@ $log->debug("remove_connection: $clid"); } +sub get_connection { + my ( $self, $clid ) = @_; + + return $self->{conn}->{$clid}; +} + sub clid_for_connection { my ( $self, $conn ) = @_; === Slim/Web/Cometd.pm ================================================================== --- Slim/Web/Cometd.pm (revision 40984) +++ Slim/Web/Cometd.pm (local) @@ -296,6 +296,13 @@ # Tell HTTP client our transport $conn->[HTTP_CLIENT]->transport( 'streaming' ); } + + # Bug 8707, Find previous streaming connection using the + # same clientId and mark it as 'old' + if ( my $old = $manager->get_connection( $clid ) ) { + $log->debug( 'Marking connection ' . $old->[HTTP_CLIENT] . ' as old' ); + $old->[HTTP_CLIENT]->transport( 'streaming-old' ); + } # Tell the manager about the new connection $manager->register_connection( $clid, $conn );