Immediately commit all changes to the TOFU DB, so it gets unlocked and multiple clients can access it at once.
This commit is contained in:
parent
13f885c226
commit
991de05512
3
av98.py
3
av98.py
|
@ -668,6 +668,7 @@ Slow internet connection? Use 'set timeout' to be more patient.""")
|
||||||
SET last_seen=?, count=?
|
SET last_seen=?, count=?
|
||||||
WHERE hostname=? AND address=? AND fingerprint=?""",
|
WHERE hostname=? AND address=? AND fingerprint=?""",
|
||||||
(now, count+1, host, address, fingerprint))
|
(now, count+1, host, address, fingerprint))
|
||||||
|
self.db_conn.commit()
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
self._debug("TOFU: Unrecognised certificate {}! Raising the alarm...".format(fingerprint))
|
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
|
self.db_cur.execute("""INSERT INTO cert_cache
|
||||||
VALUES (?, ?, ?, ?, ?, ?)""",
|
VALUES (?, ?, ?, ?, ?, ?)""",
|
||||||
(host, address, fingerprint, now, now, 1))
|
(host, address, fingerprint, now, now, 1))
|
||||||
|
self.db_conn.commit()
|
||||||
else:
|
else:
|
||||||
raise Exception("TOFU Failure!")
|
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
|
self.db_cur.execute("""INSERT INTO cert_cache
|
||||||
VALUES (?, ?, ?, ?, ?, ?)""",
|
VALUES (?, ?, ?, ?, ?, ?)""",
|
||||||
(host, address, fingerprint, now, now, 1))
|
(host, address, fingerprint, now, now, 1))
|
||||||
|
self.db_conn.commit()
|
||||||
|
|
||||||
def _get_handler_cmd(self, mimetype):
|
def _get_handler_cmd(self, mimetype):
|
||||||
# Now look for a handler for this mimetype
|
# Now look for a handler for this mimetype
|
||||||
|
|
Loading…
Reference in New Issue