Module: sip-router
Branch: andrei/tcp_tls_changes
Commit: 1ea3a8c7842ed59309b6d555492921eba7459d44
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1ea3a8c…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Fri Jun 4 22:20:16 2010 +0200
tls: tls.list rpc: fix timeout & ip display
- fix ip address display
- fix timeout computation
---
modules/tls/tls_rpc.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules/tls/tls_rpc.c b/modules/tls/tls_rpc.c
index 650c972..0013142 100644
--- a/modules/tls/tls_rpc.c
+++ b/modules/tls/tls_rpc.c
@@ -116,15 +116,15 @@ static void tls_list(rpc_t* rpc, void* c)
tls_d = con->extra_data;
rpc->add(c, "{", &handle);
/* tcp data */
- if (ip_addr2sbuf(&con->rcv.src_ip, src_ip, sizeof(src_ip)) == 0) {
+ if ((len = ip_addr2sbuf(&con->rcv.src_ip, src_ip, sizeof(src_ip)))
+ == 0)
BUG("failed to convert source ip");
- src_ip[0]=0;
- }
- if (ip_addr2sbuf(&con->rcv.dst_ip, dst_ip, sizeof(dst_ip)) == 0) {
+ src_ip[len] = 0;
+ if ((len = ip_addr2sbuf(&con->rcv.dst_ip, dst_ip, sizeof(dst_ip)))
+ == 0)
BUG("failed to convert destination ip");
- dst_ip[0]=0;
- }
- timeout = TICKS_TO_S(con->timeout - get_ticks());
+ dst_ip[len] = 0;
+ timeout = TICKS_TO_S(con->timeout - get_ticks_raw());
rpc->struct_add(handle, "ddsdsd",
"id", con->id,
"timeout", timeout,