From 899c2bb9cc618e887709f933147960297924cb46 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 7 Nov 2013 01:09:53 +0100 Subject: input/curl: unregister removed sockets from epoll Fixes a crash bug. See code comment. --- src/input/CurlInputPlugin.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/input') diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx index d17937976..841db6ceb 100644 --- a/src/input/CurlInputPlugin.cxx +++ b/src/input/CurlInputPlugin.cxx @@ -192,7 +192,15 @@ public: :SocketMonitor(_fd, _loop), multi(_multi) {} ~CurlSocket() { - Abandon(); + /* TODO: sometimes, CURL uses CURL_POLL_REMOVE after + closing the socket, and sometimes, it uses + CURL_POLL_REMOVE just to move the (still open) + connection to the pool; in the first case, + Abandon() would be most appropriate, but it breaks + the second case - is that a CURL bug? is there a + better solution? */ + + Steal(); } /** -- cgit v1.2.3