Closed cpswan closed 2 years ago
Describe the bug
Daemon crashes if asked to connect to a name that can't be found:
WARNING|2022-05-09 13:13:32.752313| sshnpd |ssh session started from: @cpswan session: e7a8f58b-3e99-4675-8aff-96b1533f8903 Unhandled exception: SocketException: Failed host lookup: 'bad.name.net' (OS Error: Name or service not known, errno = -2) #0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:682) #1 _NativeSocket.connect (dart:io-patch/socket_patch.dart:948) #2 _RawSocket.connect (dart:io-patch/socket_patch.dart:1805) #3 RawSocket.connect (dart:io-patch/socket_patch.dart:21) #4 Socket._connect (dart:io-patch/socket_patch.dart:2028) #5 Socket.connect (dart:io/socket.dart:776) #6 connectNativeSocket (package:dartssh2/src/socket/ssh_socket_io.dart:12) #7 SSHSocket.connect (package:dartssh2/src/socket/ssh_socket.dart:13) #8 sshCallback (file:///home/ubuntu/sshnoports/bin/sshnpd.dart:269) <asynchronous suspension>
To Reproduce Steps to reproduce the behavior:
./sshnp/sshnp --from @cpswan --to @bareindoornetball --device demovm -h bad.name.net
good.name.com
Expected behavior
Daemon catches the exception and stays up.
Thanks for the bug report, will fix this for next release..
FIxed, try block did not include the Socket.connect (doh).. Commited to trunk will be in next release
Describe the bug
Daemon crashes if asked to connect to a name that can't be found:
To Reproduce Steps to reproduce the behavior:
./sshnp/sshnp --from @cpswan --to @bareindoornetball --device demovm -h bad.name.net
good.name.com
Expected behavior
Daemon catches the exception and stays up.