Hi everybody,
I have problems with resty-redis:
My testing code:
local redis = require "resty.redis"
local json = require "cjson"
local red = redis:new()
-- local socket = "unix:/tmp/redis.sock"
-- local ok, err = red:connect(socket)
local ok, err = red:connect("127.0.0.1", 6379)
if not ok then
ngx.log(ngx.ERR, socket .. ' ' .. err)
ngx.say("failed to connect: ", err)
return
end
result, err = red:hmset(test, name,3, ololo, 2, desc, 1)
res, err = red:hmget(test, name)
if not ok then
ngx.say("failed to get: ", err)
return
end
ngx.say(res)
If I'll using the hmset/hmget i haven't request.
Tcpdump output:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
22:35:18.141220 IP 127.0.0.1.59817 > 127.0.0.1.6379: Flags [S], seq
1761501990, win 32792, options [mss 16396,sackOK,TS val 1424521229 ecr
0,nop,wscale 5], length 0
E..<.+@.@.!.............h.c&..............@....
........
22:35:18.141233 IP 127.0.0.1.6379 > 127.0.0.1.59817: Flags [S.], seq
3856732996, ack 1761501991, win 32768, options [mss 16396,sackOK,TS
val 1424521229 ecr 1424521229,nop,wscale 5], length 0
E..<..@.@.<................Dh.c'....-.....@....
....
22:35:18.141246 IP 127.0.0.1.59817 > 127.0.0.1.6379: Flags [.], ack 1,
win 1025, options [nop,nop,TS val 1424521229 ecr 1424521229], length 0
E..4.,@.@.!.............h.c'...E...........
T.x
22:35:18.141721 IP 127.0.0.1.59817 > 127.0.0.1.6379: Flags [P.], seq
1:16, ack 1, win 1025, options [nop,nop,TS val 1424521229 ecr
1424521229], length 15
E..C.-@.@.!.............h.c'...E.....7.....
*8x
$5
hmset
22:35:18.141732 IP 127.0.0.1.6379 > 127.0.0.1.59817: Flags [.], ack
16, win 1024, options [nop,nop,TS val 1424521229 ecr 1424521229],
length 0
E..4kH@.@..y...............Eh.c6...........
T.x
It's correct output with use redis-cli:
E..<..@.@.<.............y.!....E....<c....@....
T...T.......
22:44:55.585859 IP localhost.59820 > localhost.6379: Flags [.], ack 1,
win 1025, options [nop,nop,TS val 1424665590 ecr 1424665590], length 0
E..4n.@.@..................Ey.!.....!......
T...T...
22:44:56.743897 IP localhost.59820 > localhost.6379: Flags [P.], seq
1:78, ack 1, win 1025, options [nop,nop,TS val 1424665880 ecr
1424665590], length 77
E...n.@.@..................Ey.!......u.....
T...T...*8
$5
hmset
$4
test
$4
name
$1
3
$5
ololo
$1
2
$4
desc
$1
1
22:44:56.743904 IP localhost.6379 > localhost.59820: Flags [.], ack
78, win 1024, options [nop,nop,TS val 1424665880 ecr 1424665880],
length 0
E..4..@.@...............y.!................
T...T...
22:44:56.744034 IP localhost.6379 > localhost.59820: Flags [P.], seq
1:6, ack 78, win 1024, options [nop,nop,TS val 1424665880 ecr
1424665880], length 5
E..9..@.@...............y.!..........-.....
T...T...+OK
We've HMSET without args. :(
Thank you.
--
Regards,
Veniamin