atsign-foundation / noports

Connect to any device with no external listening ports open
https://noports.com
BSD 3-Clause "New" or "Revised" License
267 stars 15 forks source link

Bug: srv doesn't respect --local-host not being set #1041

Closed XavierChanth closed 4 months ago

XavierChanth commented 5 months ago

Describe the bug

Running a server on 1234.

srv -h localhost -p 1234 --bind-local-port --local-port 1235
SHOUT|2024-05-08 10:56:14.019751| srv.main |Unhandled exception type 'Null' is not a subtype of type 'String'; stackTrace follows
#0      main.<anonymous closure> (file:///Users/runner/work/noports/noports/packages/dart/sshnoports/bin/srv.dart:92)
#1      _rootRun (dart:async/zone.dart:1399)
#2      _CustomZone.run (dart:async/zone.dart:1301)
#3      _runZoned (dart:async/zone.dart:1804)
#4      runZonedGuarded (dart:async/zone.dart:1792)
#5      main (file:///Users/runner/work/noports/noports/packages/dart/sshnoports/bin/srv.dart:78)
#6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295)
#7      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184)

SHOUT|2024-05-08 10:56:14.019940| srv.main |Exception running srv : type 'Null' is not a subtype of type 'String'
srv -h localhost -p 1234 --bind-local-port --local-port 1235 --local-host localhost
INFO|2024-05-08 10:56:24.815862| SrvImplDart |New SrvImplDart - localPort 1235
rv started successfully

Steps to reproduce

  1. First I '...'
  2. Then I '...'
  3. And then '...'

Expected behavior

--local-host either is required or defaults to "localhost" properly. I already tested this behaviour in the C srv, so we are good there, but broke the dart one in my testing.

Screenshots

No response

Smartphones

Were you using an atApplication when the bug was found?

No response

Additional context

srv d5.2.0

gkc commented 4 months ago

Dropping to 0 SP but keeping open until PR is merged