Skip to content

Commit

Permalink
Fix error reporting TCPROSServer
Browse files Browse the repository at this point in the history
  • Loading branch information
g-gemignani committed Nov 18, 2022
1 parent bc33f0c commit b5f888d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clients/rospy/src/rospy/impl/tcpros_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,17 @@ def _tcp_server_callback(self, sock, client_addr):
header = read_ros_handshake_header(sock, StringIO(), buff_size)
else:
header = read_ros_handshake_header(sock, BytesIO(), buff_size)

if 'topic' in header:
err_msg = self.topic_connection_handler(sock, client_addr, header)
err_msg = self.topic_connection_handler(sock, client_addr, header)['error']
elif 'service' in header:
err_msg = self.service_connection_handler(sock, client_addr, header)
err_msg = self.service_connection_handler(sock, client_addr, header)['error']
else:
err_msg = 'no topic or service name detected'
if err_msg:
# shutdown race condition: nodes that come up and down
# quickly can receive connections during teardown.

# We use is_shutdown_requested() because we can get
# into bad connection states during client shutdown
# hooks.
Expand Down

0 comments on commit b5f888d

Please sign in to comment.