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

box.net.box works with big packages properly. closes #518

parent 8c281773
No related branches found
No related tags found
No related merge requests found
......@@ -517,11 +517,12 @@ local remote_methods = {
end
local len, off = msgpack.decode(self.rbuf)
if len < #self.rbuf - off then
return
-- wait for correct package length
if len + off - 1 > #self.rbuf then
break
end
local hdr, body
hdr, off = msgpack.decode(self.rbuf, off)
if off < #self.rbuf then
......
......@@ -382,6 +382,35 @@ cn:call('test_foo', 'a', 'b', 'c')
- [{'b': 2}]
- ['c']
...
-- long replies
function long_rep() return { 1, string.rep('a', 5000) } end
---
...
res = cn:call('long_rep')
---
...
res[1][1] == 1
---
- true
...
res[1][2] == string.rep('a', 5000)
---
- true
...
function long_rep() return { 1, string.rep('a', 50000) } end
---
...
res = cn:call('long_rep')
---
...
res[1][1] == 1
---
- true
...
res[1][2] == string.rep('a', 50000)
---
- true
...
-- auth
cn.proto.b64decode('gJLocxbO32VmfO8x04xRVxKfgwzmNVM2t6a1ME8XsD0=')
---
......
......@@ -136,11 +136,21 @@ cn:call('test_foo', 'a', 'b', 'c')
remote.self:call('test_foo', 'a', 'b', 'c')
cn:call('test_foo', 'a', 'b', 'c')
-- long replies
function long_rep() return { 1, string.rep('a', 5000) } end
res = cn:call('long_rep')
res[1][1] == 1
res[1][2] == string.rep('a', 5000)
function long_rep() return { 1, string.rep('a', 50000) } end
res = cn:call('long_rep')
res[1][1] == 1
res[1][2] == string.rep('a', 50000)
-- auth
cn.proto.b64decode('gJLocxbO32VmfO8x04xRVxKfgwzmNVM2t6a1ME8XsD0=')
cn.proto.b64decode('gJLoc!!!!!!!')
cn = remote:new('127.0.0.1', port, { user = 'netbox', password = '123', wait_connected = true })
cn:is_connected()
cn.error
......@@ -172,6 +182,8 @@ remote.self:ping()
remote.self.space.net_box_test_space:select{234}
remote.self:timeout(123).space.net_box_test_space:select{234}
-- cleanup database after tests
space:drop()
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