From c1b22dfdd6a87b226235a7401b41cb39df906448 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 6 Nov 2013 00:00:21 -0800 Subject: [PATCH] added force_crash to test crashing behavior --- libraries/voxel-server-library/src/VoxelServer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libraries/voxel-server-library/src/VoxelServer.cpp b/libraries/voxel-server-library/src/VoxelServer.cpp index bfb7022dc0..3072cf9599 100644 --- a/libraries/voxel-server-library/src/VoxelServer.cpp +++ b/libraries/voxel-server-library/src/VoxelServer.cpp @@ -110,6 +110,17 @@ void VoxelServer::initMongoose(int port) { int VoxelServer::civetwebRequestHandler(struct mg_connection* connection) { const struct mg_request_info* ri = mg_get_request_info(connection); + + if (strcmp(ri->uri, "/force_crash") == 0 && strcmp(ri->request_method, "GET") == 0) { + qDebug() << "About to force a crash!\n"; + int foo; + int* forceCrash = &foo; + mg_printf(connection, "%s", "HTTP/1.0 200 OK\r\n\r\n"); + mg_printf(connection, "%s", "forcing a crash....\r\n"); + delete[] forceCrash; + mg_printf(connection, "%s", "did it crash....\r\n"); + return 1; + } if (strcmp(ri->uri, "/") == 0 && strcmp(ri->request_method, "GET") == 0) { uint64_t checkSum;