vici: Support thread cancellation in command callbacks

This commit is contained in:
Martin Willi
2014-05-07 14:13:35 +02:00
parent 045bdf5283
commit ecc4b51048
2 changed files with 53 additions and 19 deletions
+3 -1
View File
@@ -18,6 +18,7 @@
#include <daemon.h>
#include <threading/mutex.h>
#include <threading/rwlock.h>
#include <threading/thread.h>
#include <collections/array.h>
#include <collections/linked_list.h>
#include <processing/jobs/callback_job.h>
@@ -374,8 +375,9 @@ CALLBACK(on_read, bool,
if (data.len)
{
thread_cleanup_push(free, data.ptr);
entry->this->inbound(entry->this->user, entry->id, data);
chunk_clear(&data);
thread_cleanup_pop(TRUE);
}
return ret;