From e89079e86c1294cefa7a2f6049026368afe493bb Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 4 Nov 2013 15:32:53 -0800 Subject: [PATCH 1/3] add server config to the status page --- libraries/voxel-server-library/src/VoxelServer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libraries/voxel-server-library/src/VoxelServer.cpp b/libraries/voxel-server-library/src/VoxelServer.cpp index b6b7ae92ae..f77d610980 100644 --- a/libraries/voxel-server-library/src/VoxelServer.cpp +++ b/libraries/voxel-server-library/src/VoxelServer.cpp @@ -112,6 +112,18 @@ int VoxelServer::civetwebRequestHandler(struct mg_connection* connection) { // return a 200 mg_printf(connection, "%s", "HTTP/1.0 200 OK\r\n\r\n"); mg_printf(connection, "%s", "Your Voxel Server is running.\r\n"); + + + + mg_printf(connection, "%s", "\r\n"); + mg_printf(connection, "%s", "Configuration: \r\n "); + for (int i = 1; i < GetInstance()->_argc; i++) { + mg_printf(connection, "%s ", GetInstance()->_argv[i]); + } + mg_printf(connection, "%s", "\r\n"); + mg_printf(connection, "%s", "\r\n"); + + mg_printf(connection, "%s", "Current Statistics\r\n"); mg_printf(connection, "%s", "\r\n"); From 9e88cfe9531d7b5a8aac981892b596daa210f5ba Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 4 Nov 2013 15:33:28 -0800 Subject: [PATCH 2/3] initlaize sortedChildren[] array to help prevent possible crashes --- libraries/voxels/src/VoxelTree.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/voxels/src/VoxelTree.cpp b/libraries/voxels/src/VoxelTree.cpp index f7519865a8..f436c8f68f 100644 --- a/libraries/voxels/src/VoxelTree.cpp +++ b/libraries/voxels/src/VoxelTree.cpp @@ -109,9 +109,9 @@ void VoxelTree::recurseNodeWithOperationDistanceSorted(VoxelNode* node, RecurseV if (operation(node, extraData)) { // determine the distance sorted order of our children - VoxelNode* sortedChildren[NUMBER_OF_CHILDREN]; - float distancesToChildren[NUMBER_OF_CHILDREN]; - int indexOfChildren[NUMBER_OF_CHILDREN]; // not really needed + VoxelNode* sortedChildren[NUMBER_OF_CHILDREN] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; + float distancesToChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + int indexOfChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; // not really needed int currentCount = 0; for (int i = 0; i < NUMBER_OF_CHILDREN; i++) { @@ -1231,9 +1231,9 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outp int inViewNotLeafCount = 0; int inViewWithColorCount = 0; - VoxelNode* sortedChildren[NUMBER_OF_CHILDREN]; - float distancesToChildren[NUMBER_OF_CHILDREN]; - int indexOfChildren[NUMBER_OF_CHILDREN]; // not really needed + VoxelNode* sortedChildren[NUMBER_OF_CHILDREN] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; + float distancesToChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + int indexOfChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; // not really needed int currentCount = 0; for (int i = 0; i < NUMBER_OF_CHILDREN; i++) { From 7daff4c27940f0d22876672de6558123bb90a342 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 4 Nov 2013 15:36:46 -0800 Subject: [PATCH 3/3] coding standard cleanup --- libraries/voxels/src/VoxelTree.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/voxels/src/VoxelTree.cpp b/libraries/voxels/src/VoxelTree.cpp index f436c8f68f..251a6300f2 100644 --- a/libraries/voxels/src/VoxelTree.cpp +++ b/libraries/voxels/src/VoxelTree.cpp @@ -109,10 +109,10 @@ void VoxelTree::recurseNodeWithOperationDistanceSorted(VoxelNode* node, RecurseV if (operation(node, extraData)) { // determine the distance sorted order of our children - VoxelNode* sortedChildren[NUMBER_OF_CHILDREN] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - float distancesToChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - int indexOfChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; // not really needed - int currentCount = 0; + VoxelNode* sortedChildren[NUMBER_OF_CHILDREN] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; + float distancesToChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + int indexOfChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + int currentCount = 0; for (int i = 0; i < NUMBER_OF_CHILDREN; i++) { VoxelNode* childNode = node->getChildAtIndex(i); @@ -1231,10 +1231,10 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outp int inViewNotLeafCount = 0; int inViewWithColorCount = 0; - VoxelNode* sortedChildren[NUMBER_OF_CHILDREN] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - float distancesToChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - int indexOfChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; // not really needed - int currentCount = 0; + VoxelNode* sortedChildren[NUMBER_OF_CHILDREN] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; + float distancesToChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + int indexOfChildren[NUMBER_OF_CHILDREN] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + int currentCount = 0; for (int i = 0; i < NUMBER_OF_CHILDREN; i++) { VoxelNode* childNode = node->getChildAtIndex(i);