From e1d10bba7eeac3f4bb99a8f3a164d222ec7f609e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 13 Dec 2007 02:48:30 +0000 Subject: [PATCH] add extra debugging messages for upnpDiscover() --- libtransmission/upnp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libtransmission/upnp.c b/libtransmission/upnp.c index 0263054ff..11dd5a7ee 100644 --- a/libtransmission/upnp.c +++ b/libtransmission/upnp.c @@ -88,7 +88,12 @@ tr_upnpPulse( tr_upnp * handle, int port, int isEnabled ) if( handle->state == TR_UPNP_DISCOVER ) { - struct UPNPDev * devlist = upnpDiscover( 2000, NULL ); + struct UPNPDev * devlist; + errno = 0; + devlist = upnpDiscover( 2000, NULL ); + if( devlist == NULL ) { + tr_err( KEY "upnpDiscover returned NULL (errno %d - %s)", errno, strerror(errno) ); + } errno = 0; if( UPNP_GetValidIGD( devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr))) { tr_inf( KEY "found Internet Gateway Device '%s'", handle->urls.controlURL );