lookip: Disconnect asynchronously to avoid dead-locking watcher unregistration

While it really would be desirable to allow stream destruction during on_read()
callbacks, this does not work anymore since e49b2998. Until we have a proper
solution for this issue, use asynchronous disconnects for the only user doing
so.

Fixes #518.
This commit is contained in:
Martin Willi
2014-02-17 09:48:55 +01:00
parent 1f9e4d029e
commit 961409b668
2 changed files with 32 additions and 6 deletions
@@ -39,9 +39,8 @@ typedef stream_t*(*stream_constructor_t)(char *uri);
/**
* Callback function prototype, called when stream is ready.
*
* It is allowed to destroy the stream during the callback, but only if it has
* no other active on_read()/on_write() callback and returns FALSE. It is not
* allowed to to call on_read()/on_write/() during the callback.
* It is not allowed to destroy the stream nor to call on_read()/on_write/()
* during the callback.
*
* As select() may return even if a read()/write() would actually block, it is
* recommended to use the non-blocking calls and handle return values