kitten @: Fix a regression connecting to TCP sockets using plain IP addresses rather than hostnames

Fixes #7794
This commit is contained in:
Kovid Goyal 2024-08-27 18:30:51 +05:30
parent 0515dc1957
commit fdc3c3d7c1
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 1 deletions

View file

@ -85,6 +85,8 @@ Detailed list of changes
- Remote control: When listening on a UNIX domain socket only allow connections from processes having the same user id (:pull:`7777`)
- kitten @: Fix a regression connecting to TCP sockets using plain IP addresses rather than hostnames (:iss:`7794`)
0.36.1 [2024-08-24]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -174,8 +174,10 @@ func do_socket_io(io_data *rc_io_data) (serialized_response []byte, err error) {
}
defer f.Close()
} else {
conn, err = net.Dial(global_options.to_network, global_options.to_address)
network := utils.IfElse(global_options.to_network == "ip", "tcp", global_options.to_network)
conn, err = net.Dial(network, global_options.to_address)
if err != nil {
err = fmt.Errorf("Failed to connect to %s %s with error: %w", network, global_options.to_address, err)
return
}
}