[SR-Users] pkg.stats problem

Vitaliy Aleksandrov vitalik.voip at gmail.com
Mon Sep 30 18:14:10 CEST 2013


I found one place where tcpconn_put() never called after tcpconn_get():
--- a/msg_translator.c
+++ b/msg_translator.c
@@ -2509,9 +2509,11 @@ char* via_builder( unsigned int *len,
                 } else if (con->rcv.proto==PROTO_WSS) {
                         memcpy(line_buf+MY_VIA_LEN-4, "WSS ", 4);
                 } else {
+                       tcpconn_put(con);
                         LOG(L_CRIT, "BUG: via_builder: unknown proto 
%d\n", con->rcv.proto);
                         return 0;
                 }
+               tcpconn_put(con);
         }else if (send_info->proto==PROTO_WSS){
                 memcpy(line_buf+MY_VIA_LEN-4, "WSS ", 4);
         }else{

I've tried this patch and it fixed my problem with constantly growing 
ref_count for WSS connections.

Could you please share why nathelper aggregates both WS and WSS 
transports to "ws" and then msg_translator have to detect the type of a 
connection to a destination to build correct via ?

modules/nathelper/nathelper.c create_rcv_uri() function :
         case PROTO_WS:
         case PROTO_WSS:
                 proto.s = "WS";
                 proto.len = 2;
                 break;




More information about the sr-users mailing list