From 06cad3a245cb9c5ba161fd78c1c8957aa4193131 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 18 Sep 2011 20:28:06 +0000 Subject: [PATCH] fix UPnP issue for routers with multiple PPPoE connections --- ChangeLog | 1 + src/upnp.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3170b81e4..97861b9e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -92,6 +92,7 @@ incoming connection * added more detailed instrumentation of the disk I/O thread + * fix UPnP issue for routers with multiple PPPoE connections * fix issue where event=stopped announces wouldn't be sent when closing session * fix possible hang in file::readv() on windows * fix CPU busy loop issue in tracker announce logic diff --git a/src/upnp.cpp b/src/upnp.cpp index 2afac35e3..cae0cb371 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -820,8 +820,9 @@ TORRENT_EXPORT void find_control_url(int type, char const* string, parse_state& if (string_equal_no_case(string, state.service_type)) state.in_service = true; } - else if (state.in_service && state.top_tags("service", "controlurl")) + else if (state.control_url.empty() && state.in_service && state.top_tags("service", "controlurl")) { + // default to the first (or only) control url in the router's listing state.control_url = string; } else if (state.model.empty() && state.top_tags("device", "modelname"))