diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-01-26 12:42:44 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-01-26 12:42:44 -0800 |
| commit | 9cb4bbe2b879f766c7cdfc998ddd55d15ce201a2 (patch) | |
| tree | f28e02a89ae58d02229ad1ec2acf1ed4f650c245 /controller/SqliteNetworkController.hpp | |
| parent | 95d28494f6fbe352ac7746f0c544e3527534ba0d (diff) | |
| download | infinitytier-9cb4bbe2b879f766c7cdfc998ddd55d15ce201a2.tar.gz infinitytier-9cb4bbe2b879f766c7cdfc998ddd55d15ce201a2.zip | |
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.
Diffstat (limited to 'controller/SqliteNetworkController.hpp')
| -rw-r--r-- | controller/SqliteNetworkController.hpp | 11 |
1 files changed, 7 insertions, 4 deletions
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<Address,uint64_t>,_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; |
