From 3a77185e1e69c9943a789264ba646d6da5f0d6ef Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sun, 18 Nov 2007 05:18:12 +0000 Subject: [PATCH] reanable lsd with custom fix to lt --- libtorrent/src/lsd.cpp | 2 +- libtorrent/src/session_impl.cpp | 2 ++ src/deluge_core.cpp | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libtorrent/src/lsd.cpp b/libtorrent/src/lsd.cpp index 06e570f3c..f4bee3610 100644 --- a/libtorrent/src/lsd.cpp +++ b/libtorrent/src/lsd.cpp @@ -183,9 +183,9 @@ void lsd::on_announce(udp::endpoint const& from, char* buffer void lsd::close() { - m_socket.close(); m_broadcast_timer.cancel(); m_disabled = true; m_callback.clear(); + m_socket.close(); } diff --git a/libtorrent/src/session_impl.cpp b/libtorrent/src/session_impl.cpp index c41079fdc..3132b80c9 100755 --- a/libtorrent/src/session_impl.cpp +++ b/libtorrent/src/session_impl.cpp @@ -2317,6 +2317,8 @@ namespace detail void session_impl::stop_lsd() { mutex_t::scoped_lock l(m_mutex); + if (m_lsd.get()) + m_lsd->close(); m_lsd = 0; } diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index c4f9a797d..39730c851 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -1642,13 +1642,12 @@ static PyObject *torrent_use_lsd(PyObject *self, PyObject *args) python_long action; PyArg_ParseTuple(args, "i", &action); -/* if (action){ + if (action){ M_ses->start_lsd(); } else{ M_ses->stop_lsd(); } -*/ Py_INCREF(Py_None); return Py_None; }