Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
71521a7c
Commit
71521a7c
authored
10 years ago
by
Dmitry E. Oboukhov
Browse files
Options
Downloads
Plain Diff
Merge branch 'stable'
Conflicts: test/box/bsdsocket.result test/box/bsdsocket.test
parents
589738d0
71463c32
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/lua/bsdsocket.lua
+18
-0
18 additions, 0 deletions
src/lua/bsdsocket.lua
test/box/bsdsocket.result
+8
-0
8 additions, 0 deletions
test/box/bsdsocket.result
test/box/bsdsocket.test.lua
+1
-0
1 addition, 0 deletions
test/box/bsdsocket.test.lua
with
27 additions
and
0 deletions
src/lua/bsdsocket.lua
+
18
−
0
View file @
71521a7c
...
...
@@ -852,6 +852,22 @@ local function getaddrinfo(host, port, timeout, opts)
return
internal
.
getaddrinfo
(
host
,
port
,
timeout
,
ga_opts
)
end
local
soname_mt
=
{
__tostring
=
function
(
si
)
if
si
.
host
==
nil
and
si
.
port
==
nil
then
return
''
end
if
si
.
host
==
nil
then
return
sprintf
(
'%s:%s'
,
'0'
,
tostring
(
si
.
port
))
end
if
si
.
port
==
nil
then
return
sprintf
(
'%s:%'
,
tostring
(
si
.
host
),
0
)
end
return
sprintf
(
'%s:%s'
,
tostring
(
si
.
host
),
tostring
(
si
.
port
))
end
}
socket_methods
.
name
=
function
(
self
)
local
aka
=
internal
.
name
(
self
.
fh
)
if
aka
==
nil
then
...
...
@@ -859,6 +875,7 @@ socket_methods.name = function(self)
return
nil
end
self
.
_errno
=
nil
setmetatable
(
aka
,
soname_mt
)
return
aka
end
...
...
@@ -869,6 +886,7 @@ socket_methods.peer = function(self)
return
nil
end
self
.
_errno
=
nil
setmetatable
(
peer
,
soname_mt
)
return
peer
end
...
...
This diff is collapsed.
Click to expand it.
test/box/bsdsocket.result
+
8
−
0
View file @
71521a7c
...
...
@@ -642,6 +642,14 @@ json.encode(sc:name())
---
- '{"host":"0.0.0.0","family":"AF_INET","type":"SOCK_STREAM","protocol":"tcp","port":0}'
...
sc:name()
---
- host: 0.0.0.0
family: AF_INET
type: SOCK_STREAM
protocol: tcp
port: 0
...
sc:nonblock(true)
---
- true
...
...
This diff is collapsed.
Click to expand it.
test/box/bsdsocket.test.lua
+
1
−
0
View file @
71521a7c
...
...
@@ -205,6 +205,7 @@ json.encode(socket.getaddrinfo('ya.ru', '80',
sc
=
socket
(
'AF_INET'
,
'SOCK_STREAM'
,
'tcp'
)
json
.
encode
(
sc
:
name
())
sc
:
name
()
sc
:
nonblock
(
true
)
sc
:
close
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment