commit 991de05512eb6637f32e70e1a22bfa8c598a108c
parent 13f885c226fa3aae44f4857b39b170fadf11c87d
Author: Solderpunk <solderpunk@sdf.org>
Date: Sun, 17 May 2020 14:02:36 +0200
Immediately commit all changes to the TOFU DB, so it gets unlocked and multiple clients can access it at once.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/av98.py b/av98.py
@@ -668,6 +668,7 @@ Slow internet connection? Use 'set timeout' to be more patient.""")
SET last_seen=?, count=?
WHERE hostname=? AND address=? AND fingerprint=?""",
(now, count+1, host, address, fingerprint))
+ self.db_conn.commit()
break
else:
self._debug("TOFU: Unrecognised certificate {}! Raising the alarm...".format(fingerprint))
@@ -684,6 +685,7 @@ Slow internet connection? Use 'set timeout' to be more patient.""")
self.db_cur.execute("""INSERT INTO cert_cache
VALUES (?, ?, ?, ?, ?, ?)""",
(host, address, fingerprint, now, now, 1))
+ self.db_conn.commit()
else:
raise Exception("TOFU Failure!")
@@ -693,6 +695,7 @@ Slow internet connection? Use 'set timeout' to be more patient.""")
self.db_cur.execute("""INSERT INTO cert_cache
VALUES (?, ?, ?, ?, ?, ?)""",
(host, address, fingerprint, now, now, 1))
+ self.db_conn.commit()
def _get_handler_cmd(self, mimetype):
# Now look for a handler for this mimetype