summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Alfredsen <loki_val@gentoo.org>2008-09-16 07:11:43 +0000
committerPeter Alfredsen <loki_val@gentoo.org>2008-09-16 07:11:43 +0000
commitc059488fccc2f55931c263be46ad988b1eb8475e (patch)
tree5e1b31a9052d58d638202f8275fe66654f97c2aa /net-libs/libtorrent/files
parentnew upstream release (diff)
downloadgentoo-2-c059488fccc2f55931c263be46ad988b1eb8475e.tar.gz
gentoo-2-c059488fccc2f55931c263be46ad988b1eb8475e.tar.bz2
gentoo-2-c059488fccc2f55931c263be46ad988b1eb8475e.zip
rtorrent-0.8.3/libtorrent-0.12.3 bump
(Portage version: 2.2_rc8/cvs/Linux 2.6.25.8 i686)
Diffstat (limited to 'net-libs/libtorrent/files')
-rw-r--r--net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch b/net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch
new file mode 100644
index 000000000000..214c78570c04
--- /dev/null
+++ b/net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch
@@ -0,0 +1,33 @@
+# Fixes a crash in epoll due to libcurl/c-ares bug:
+# PollEPoll::modify(...) epoll_ctl call failed
+Index: libtorrent/src/torrent/poll_epoll.cc
+===================================================================
+--- libtorrent/src/torrent/poll_epoll.cc (revision 1067)
++++ libtorrent/src/torrent/poll_epoll.cc (working copy)
+@@ -75,12 +75,21 @@
+
+ set_event_mask(event, mask);
+
+- // If error is EEXIST, try again with EPOLL_CTL_MOD.
+- // libcurl with c-ares may unwittingly re-open an FD closed by
+- // c-ares before notified (and thus notifying us) of its closure.
+ if (epoll_ctl(m_fd, op, event->file_descriptor(), &e)) {
+- if (op != EPOLL_CTL_ADD || errno != EEXIST ||
+- epoll_ctl(m_fd, EPOLL_CTL_MOD, event->file_descriptor(), &e))
++ // Socket was probably already closed. Ignore this.
++ if (op == EPOLL_CTL_DEL && errno == ENOENT)
++ return;
++
++ // Handle some libcurl/c-ares bugs by retrying once.
++ if (op == EPOLL_CTL_ADD && errno == EEXIST) {
++ op = EPOLL_CTL_MOD;
++ errno = 0;
++ } else if (op == EPOLL_CTL_MOD && errno == ENOENT) {
++ op = EPOLL_CTL_ADD;
++ errno = 0;
++ }
++
++ if (errno || epoll_ctl(m_fd, op, event->file_descriptor(), &e))
+ throw internal_error("PollEPoll::modify(...) epoll_ctl call failed");
+ }
+ }