Skip to content

Commit

Permalink
add error message on invalid connection header
Browse files Browse the repository at this point in the history
  • Loading branch information
sawyerbot committed Jun 25, 2021
1 parent 10d89e6 commit fef3b9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/impl/publisher_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ class PublisherImpl<T extends RosMessage> {
validateSubHeader(writer, header, topic, type, messageClass.md5sum);

if (!validated) {
final reader = ByteDataReader(endian: Endian.little);
reader.add(writer.toBytes());
log.dartros.error(
'Subscriber connection header invalid ${deserializeStringFields(reader)}');
socket.add(writer.toBytes());
await socket.flush();
await socket.close();
Expand Down

0 comments on commit fef3b9b

Please sign in to comment.