[sr-dev] redis module support for array responses.

Daniel-Constantin Mierla miconda at gmail.com
Fri Mar 30 11:47:33 CEST 2012


Hello,

indeed redis connector is dealing string and integer values by now.

Extending it for dealing with arrays will be useful, proposed variant 
looks good for me. If you are going to contribute a patch, it will be 
accepted (and appreciated).

Cheers,
Daniel

On 3/29/12 8:14 PM, Vicente Hernando wrote:
> Hello,
>
> I am studying the use case when a redis command returns an array 
> (REDIS_REPLY_ARRAY type in hiredis.h from 
> https://github.com/antirez/hiredis )
>
> Function pv_get_redisc in kamailio/modules/ndb_redis/ndb_redis_mod.c : 
> 365  returns a pv_value_t structure and currently only deals with 
> REDIS_REPLY_STRING
> and REDIS_REPLY_INTEGER cases.
>
> It seems looking at pvar.h that pv_value_t structure does not deal 
> with arrays. Is that correct? So returning an array is not an option...
>
> Then a better aproach could be changing pv_parse_redisc_name function:
>
> right now from README in ndb_redis:
> after executing redis_cmd("srvN", "SET foo bar", "r");     I could 
> get   $redis(r->type)   and $redis(r->value)
>
> it could be a good idea to add options like:  $redis(r->size)   and  
> $redis(r->value[Number])     when changing pv_parse_redisk_name function.
>
>
> Do you think of that as a good approach?
>
>
> Thanks in advance!
> Vicente.
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
http://www.asipto.com/index.php/kamailio-advanced-training/




More information about the sr-dev mailing list