[sr-dev] git:master:3d6f5770: websocket: split the addition of info structure for ws.dump rpc

Daniel-Constantin Mierla miconda at gmail.com
Thu Mar 9 12:04:03 CET 2017


Module: kamailio
Branch: master
Commit: 3d6f5770b456f2ec63d1c722fc7d3c518cb7c326
URL: https://github.com/kamailio/kamailio/commit/3d6f5770b456f2ec63d1c722fc7d3c518cb7c326

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-03-09T12:02:57+01:00

websocket: split the addition of info structure for ws.dump rpc

- related to GH #1022

---

Modified: src/modules/websocket/ws_conn.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3d6f5770b456f2ec63d1c722fc7d3c518cb7c326.diff
Patch: https://github.com/kamailio/kamailio/commit/3d6f5770b456f2ec63d1c722fc7d3c518cb7c326.patch

---

diff --git a/src/modules/websocket/ws_conn.c b/src/modules/websocket/ws_conn.c
index 8b0dc84..ad3d216 100644
--- a/src/modules/websocket/ws_conn.c
+++ b/src/modules/websocket/ws_conn.c
@@ -622,8 +622,7 @@ void ws_rpc_dump(rpc_t* rpc, void* ctx)
 		rpc->fault(ctx, 500, "Internal error root reply");
 		return;
 	}
-	if(rpc->struct_add(th, "[{",
-				"connections", &ih,  "info", &dh)<0)
+	if(rpc->struct_add(th, "[", "connections", &ih)<0)
 	{
 		rpc->fault(ctx, 500, "Internal error connections structure");
 		return;
@@ -702,6 +701,11 @@ void ws_rpc_dump(rpc_t* rpc, void* ctx)
 	}
 	WSCONN_UNLOCK;
 
+	if(rpc->struct_add(th, "{", "info", &dh)<0)
+	{
+		rpc->fault(ctx, 500, "Internal error info structure");
+		return;
+	}
 	if(rpc->struct_add(dh, "ds",
 				"wscounter", connections,
 				"truncated", (truncated==1)?"yes":"no")<0)




More information about the sr-dev mailing list