clear down wsi_lookup on allocation and clear pollfd revents if serviced

This should get rid of a valgrind uninitialized report when using extpoll,
and gives a new way to share the poll loop with external sockets.

If a pollfd says it has something, you can just pass it to
libwebsocket_serice_fd() whether it is a socket handled by lws or not.
If it sees it is a lws socket, the traffic will be handled and
pollfd->revents will be zeroed now.

If the socket is foreign to lws, it leaves revents alone.  So you can see
if you should service by checking the pollfd revents after letting
lws try to service it.

Signed-off-by: Andy Green <andy.green@linaro.org>
1 file changed