From 9cb4bbe2b879f766c7cdfc998ddd55d15ce201a2 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 26 Jan 2016 12:42:44 -0800 Subject: Save test results for circuit tests in memory and then cancel the test and send the results when the test is queried later. This way you can POST a test and then come GET the result at the appointed time. --- controller/SqliteNetworkController.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'controller/SqliteNetworkController.hpp') diff --git a/controller/SqliteNetworkController.hpp b/controller/SqliteNetworkController.hpp index 0e2bb63e..d58b3fc9 100644 --- a/controller/SqliteNetworkController.hpp +++ b/controller/SqliteNetworkController.hpp @@ -123,7 +123,7 @@ private: std::string _circuitTestPath; std::string _instanceId; - // A circular buffer last log + // Recent request log by device address and network ID struct _LLEntry { _LLEntry() @@ -148,12 +148,15 @@ private: // Total requests by this address / network ID pair (also serves mod IN_MEMORY_LOG_SIZE as circular buffer ptr) uint64_t totalRequests; }; - - // Last log entries by address and network ID pair std::map< std::pair,_LLEntry > _lastLog; // Circuit tests outstanding - std::map< uint64_t,ZT_CircuitTest * > _circuitTests; + struct _CircuitTestEntry + { + ZT_CircuitTest *test; + std::string jsonResults; + }; + std::map< uint64_t,_CircuitTestEntry > _circuitTests; sqlite3 *_db; -- cgit v1.2.3