Gregr, I'm using multibulk reply without pipelining. If it helps, here's a working sample.
I haven't used pipelining yet, since support for this a quite new (2011-04-03 for lua-redis-parser). Maybe try to update agentzh modules first.
#First save some test values to redis:
location /testluasetnginx
{
redis2_query hset testkey "testhash1" "value1";
redis2_query hset testkey "testhash2" "value2";
redis2_pass redisbackend;
}
#internal location for nonblocking fetch
location /testluagetnginx
{
redis2_query hgetall testkey;
redis2_pass redisbackend;
}
#test code
location /testluaparser
{
content_by_lua '
local replies = ngx.location.capture("/testluagetnginx")
local parser = require("redis.parser")
ngx.say("reply status is:",replies.status)
ngx.say("reply body is:",replies.body)
ngx.say("end of showresults")
local res,typ = parser.parse_reply(replies.body)
ngx.say("type=", typ)
ngx.say("res=", res[1])
ngx.say("res=", res[2])
ngx.say("res=", res[3])
ngx.say("res=", res[4])
';
}
#my results when using curl 'http://localhost/testluaparser'
reply status is:200
reply body is:*4
$9
testhash1
$6
value1
$9
testhash2
$6
value2
end of showresults
type=5
res=testhash1
res=value1
res=testhash2
res=value2