Tries to use local tor if address specified by --address doesn't work

From !10 (comment 3075140)

It seems even more serious, this looks like a bug to me ...

  1. if you connect to a 3rd party tor sever using an IP address: torsocks --address 123.123.123.123 wget https://www.example.com/index.html it works OK.

  2. if you connect to same 3rd party tor server using hostname e.g torsocks --address my.tor.host.name wget https://www.example.com/index.html then it wil briefly show an error (Config file unknown tor address) and continue to connect using LOCAL tor server without mentioning this in output.

  3. Only if you stop local tor server first service tor stop when try to connect to 3rd party server using a hostname: torsocks --address my.tor.proxy.tld wget https://www.example.com/index.html then it will properly fail after the error.

full error when local tor is running (continues and silently connects to local tor):

torsocks --address my.tor.proxy.tld --port 9050 wget https://www.example.com/index.html;
1726018043 ERROR torsocks[31883]: Config file unknown tor address: my.tor.proxy.tld (in conf_file_set_tor_address() at config-file.c:287)
--2024-09-11 01:27:23--  https://www.example.com/index.html
Resolving www.example.com (www.example.com)... 234.234.234.234
Connecting to www.example.com (www.example.com)|234.234.234.234|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘index.html’
2024-09-11 01:27:25 (1.28 MB/s) - ‘index.html’ saved

full error when local tor is stoped (exits properly):

torsocks --address my.tor.proxy.tld --port 9050 wget https://www.example.com/index.html;
1726018073 ERROR torsocks[31933]: Config file unknown tor address: my.tor.proxy.tld (in conf_file_set_tor_address() at config-file.c:287)
--2024-09-11 01:27:53--  https://www.example.com/index.html
Resolving www.example.com (www.example.com)... 1726018073 PERROR torsocks[31933]: socks5 libc connect: Connection refused (in socks5_connect() at socks5.c:202)
failed: Non-recoverable failure in name resolution.
wget: unable to resolve host address ‘www.example.com’