From 84a71e6c3f149cbad0967ae21e8dad3f27146546 Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Sun, 14 Feb 2016 02:08:16 +0200 Subject: [PATCH] fixed with version sync; --- lib/link.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/link.c b/lib/link.c index 3df9647..661a72e 100644 --- a/lib/link.c +++ b/lib/link.c @@ -147,7 +147,10 @@ static int __get_channels_list(void *cctx, sexp_t *sx) co->rpc_list = ssys->get_rpc_typed_list_tree(co); if(!co->rpc_list) return SXE_EPERM; //buf += sizeof(sxmplv2_head_t); - ulen += snprintf(buf + ulen, maxlen - ulen, "(set-channels-list "); + if(co->cp_version == V2) + ulen += snprintf(buf + ulen, maxlen - ulen, "(set-channels-list "); + else ulen += snprintf(buf + ulen, maxlen - ulen, "(!@c< "); + for(node = usrtc_first(co->rpc_list); node != NULL; node = usrtc_next(co->rpc_list, node)) { /* fill the list */ list_ent = (rpc_typed_list_t *)usrtc_node_getdata(node); @@ -466,6 +469,8 @@ static int __init_systemrpc_tree(usrtc_t *rtree) { /* batch mode negotiation context functions */ if(__insert_rpc_function(rtree, "auth-set-credentials", __set_credentials)) goto __fail; + + /* old version V2 */ if(__insert_rpc_function(rtree, "get-channels-list", __get_channels_list)) goto __fail; /* old V2 (v1 also) */ if(__insert_rpc_function(rtree, "set-channels-list", __set_channels_list)) goto __fail;