Wake up Cynara async thread from statusCallback 72/109772/2
authorRafal Krypa <r.krypa@samsung.com>
Wed, 11 Jan 2017 08:38:52 +0000 (09:38 +0100)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 12 Jan 2017 09:14:37 +0000 (01:14 -0800)
commit0d98680bb5ef41e36a5a3399b1bbe740f3110030
tree219ac73e73760df9e4a62d2f676361a0925de547
parentc781ad9cd6b80c4467f5847240b8cae74e3b29b8
Wake up Cynara async thread from statusCallback

Until now the thread handling communication with Cynara was woken up
when new check was prepared for sending because cynara_async_create_request
was expected to trigger statusCallback. When new data is prepared for
sending to Cynara service, statusCallback requests that the cynara descriptor
must be polled for writing and when it's ready, cynara_async_process will
send the data to socket.

But since Cynara release 0.12.0, cynara_async_check_cache may also trigger
a statusCallback. This is because of underlying monotir entries and their
periodic flush to Cynara service. This behavior of Cynara is not documented.

To make sure that security-manager will restart polling of Cynara socket
each time after statusCallback is triggered, the callBack itself will now
take care of waking up the thread responsible for communication with Cynara.

Change-Id: I8f9bf323166fccd97612dd85ec35c9befe5d00f9
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
src/common/cynara.cpp
src/common/include/cynara.h