瀏覽代碼

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

- related to GH #1022
Daniel-Constantin Mierla 8 年之前
父節點
當前提交
3d6f5770b4
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/modules/websocket/ws_conn.c

+ 6 - 2
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)