Browse code

core: Improve tcp stats output

- Add connection ref count
- Add websocket protocols

Hugh Waite authored on 04/07/2013 08:33:56
Showing 1 changed files
... ...
@@ -773,8 +773,12 @@ static void core_tcp_list(rpc_t* rpc, void* c)
773 773
 			/* tcp data */
774 774
 			if (con->rcv.proto == PROTO_TCP)
775 775
 				type = "TCP";
776
-			else if (con->rcv.proto == PROTO_TCP)
776
+			else if (con->rcv.proto == PROTO_TLS)
777 777
 				type = "TLS";
778
+			else if (con->rcv.proto == PROTO_WSS)
779
+				type = "WSS";
780
+			else if (con->rcv.proto == PROTO_WS)
781
+				type = "WS";
778 782
 			else
779 783
 				type = "UNKNOWN";
780 784
 
... ...
@@ -812,11 +816,12 @@ static void core_tcp_list(rpc_t* rpc, void* c)
812 812
 				default:
813 813
 					state = "UNKNOWN";
814 814
 			}
815
-			rpc->struct_add(handle, "dssdsdsd",
815
+			rpc->struct_add(handle, "dssddsdsd",
816 816
 					"id", con->id,
817 817
 					"type", type,
818 818
 					"state", state,
819 819
 					"timeout", timeout,
820
+					"ref_count", con->refcnt,
820 821
 					"src_ip", src_ip,
821 822
 					"src_port", con->rcv.src_port,
822 823
 					"dst_ip", dst_ip,