diff options
author | Jack Lloyd <[email protected]> | 2015-11-13 15:34:52 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-11-13 15:34:52 -0500 |
commit | 81edfc8221b9da94ac1a453e78bf57a5a739b4ce (patch) | |
tree | 14ae41bfae45495ccfc2b5d1efe2b01b28a2c849 /src/lib/utils | |
parent | 309252789ec3d3b29a7cd30f7d3095fe38e02fa2 (diff) |
Add remove_all to TLS session manager interface
DB::spin now returns the number of rows affected
Diffstat (limited to 'src/lib/utils')
-rw-r--r-- | src/lib/utils/database.h | 2 | ||||
-rw-r--r-- | src/lib/utils/sqlite3/sqlite3.cpp | 10 | ||||
-rw-r--r-- | src/lib/utils/sqlite3/sqlite3.h | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/utils/database.h b/src/lib/utils/database.h index 03a3174d6..bacbedd1e 100644 --- a/src/lib/utils/database.h +++ b/src/lib/utils/database.h @@ -36,7 +36,7 @@ class BOTAN_DLL SQL_Database virtual size_t get_size_t(int column) = 0; /* Run to completion */ - virtual void spin() = 0; + virtual size_t spin() = 0; /* Maybe update */ virtual bool step() = 0; diff --git a/src/lib/utils/sqlite3/sqlite3.cpp b/src/lib/utils/sqlite3/sqlite3.cpp index be3c2b227..267d7530a 100644 --- a/src/lib/utils/sqlite3/sqlite3.cpp +++ b/src/lib/utils/sqlite3/sqlite3.cpp @@ -125,9 +125,15 @@ size_t Sqlite3_Database::Sqlite3_Statement::get_size_t(int column) return static_cast<size_t>(sessions_int); } -void Sqlite3_Database::Sqlite3_Statement::spin() +size_t Sqlite3_Database::Sqlite3_Statement::spin() { - while(step()) {} + size_t steps = 0; + while(step()) + { + ++steps; + } + + return steps; } bool Sqlite3_Database::Sqlite3_Statement::step() diff --git a/src/lib/utils/sqlite3/sqlite3.h b/src/lib/utils/sqlite3/sqlite3.h index 8495a1d1b..067b94e85 100644 --- a/src/lib/utils/sqlite3/sqlite3.h +++ b/src/lib/utils/sqlite3/sqlite3.h @@ -39,7 +39,7 @@ class BOTAN_DLL Sqlite3_Database : public SQL_Database std::pair<const byte*, size_t> get_blob(int column) override; size_t get_size_t(int column) override; - void spin() override; + size_t spin() override; bool step() override; Sqlite3_Statement(sqlite3* db, const std::string& base_sql); |