aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/sqlite/sqlite_database.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2015-04-02 08:50:56 +0200
committerMartin Willi <martin@revosec.ch>2015-04-13 15:08:10 +0200
commitd20be3fa28e2304cbdea349b081e5a0d0eaad8e5 (patch)
tree46ea50962069125e42501f5b939f55bac9a1fa32 /src/libstrongswan/plugins/sqlite/sqlite_database.c
parent3c81cb6fc3225423ce82bbd97bd6fd9b70df8cc0 (diff)
downloadstrongswan-d20be3fa28e2304cbdea349b081e5a0d0eaad8e5.tar.bz2
strongswan-d20be3fa28e2304cbdea349b081e5a0d0eaad8e5.tar.xz
vici: Defer read/write error reporting after connection entry has been released
If a vici client registered for (control-)log events, but a vici read/write operation fails, this may result in a deadlock. The attempt to write to the bus results in a vici log message, which in turn tries to acquire the lock for the entry currently held. While a recursive lock could help as well for a single thread, there is still a risk of inter-thread races if there is more than one thread listening for events and/or having read/write errors. We instead log to a local buffer, and write to the bus not before the connection entry has been released. Additionally, we mark the connection entry as unusable to avoid writing to the failed socket again, potentially triggering an error loop.
Diffstat (limited to 'src/libstrongswan/plugins/sqlite/sqlite_database.c')
0 files changed, 0 insertions, 0 deletions