Skip to content
Snippets Groups Projects
Commit ac963b5c authored by Eden Abitbol's avatar Eden Abitbol Committed by Sébastien Blin
Browse files

upnp: fix intermittent xml download error

Depending on the platform, libupnp sometimes fails to download
the xml document provided by devices that answer the search
request. re-enabling blocking the blocking tcp connections at
compile time for libupnp seems to fix this issue.

The function used by the libupnp api to download the xml documents
is purely synchronous. To prevent the function from blocking
the upnp thread in case it hangs in the api, we used the disable
blocking tcp connection flag. Now that std::future is used to
circumvent this problem, we can re-enable the blocking tcp
connection.

Change-Id: I6efa02521e25171fcbca8c58a2c93987f5414f29
parent 97ca3a70
No related branches found
No related tags found
No related merge requests found
......@@ -25,10 +25,10 @@ endif
.upnp: upnp
ifdef HAVE_WIN32
$(RECONF)
cd $< && $(HOSTVARS) CFLAGS="-DUPNP_STATIC_LIB" ./configure --disable-largefile --disable-samples --without-documentation --disable-blocking_tcp_connections $(HOSTCONF)
cd $< && $(HOSTVARS) CFLAGS="-DUPNP_STATIC_LIB" ./configure --disable-largefile --disable-samples --without-documentation $(HOSTCONF)
else
$(RECONF)
cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) -DUPNP_STATIC_LIB" ./configure --disable-largefile --disable-samples --without-documentation --disable-blocking_tcp_connections $(HOSTCONF)
cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) -DUPNP_STATIC_LIB" ./configure --disable-largefile --disable-samples --without-documentation $(HOSTCONF)
endif
cd $< && $(MAKE) install
touch $@
......@@ -68,7 +68,7 @@ constexpr static int ARRAY_IDX_INVALID = 713;
constexpr static int CONFLICT_IN_MAPPING = 718;
// Timeout values (in seconds).
constexpr static unsigned int SEARCH_TIMEOUT {30};
constexpr static unsigned int SEARCH_TIMEOUT {5};
constexpr static unsigned int SUBSCRIBE_TIMEOUT {300};
class PUPnP : public UPnPProtocol
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment