Skip to content
Snippets Groups Projects
Commit 2d8e5fba authored by Dmitry E. Oboukhov's avatar Dmitry E. Oboukhov
Browse files

tcp_connect forces errno to EINVAL if it can solve DNS address.

parent 0eec80af
No related branches found
No related tags found
No related merge requests found
......@@ -966,6 +966,11 @@ local function tcp_connect(host, port, timeout)
if dns == nil then
return nil
end
if #dns == 0 then
box.errno(box.errno.EINVAL)
return nil
end
for i, remote in pairs(dns) do
timeout = stop - box.time()
if timeout <= 0 then
......
......@@ -1183,3 +1183,7 @@ lua s:close()
---
- true
...
lua box.cjson.encode{ box.socket.tcp_connect('test:test@localhost:3303') == nil, box.errno.strerror() }
---
- [true,"Invalid argument"]
...
......@@ -385,3 +385,6 @@ exec admin "lua s ~= nil"
exec admin "lua s:close()"
if os.path.exists(path):
print 'unix socket was not removed: test failed'
exec admin "lua box.cjson.encode{ box.socket.tcp_connect('test:test@localhost:3303') == nil, box.errno.strerror() }"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment