Changeset 4112
- Timestamp:
- Dec 9, 2007, 5:50:05 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/upnp.c
r4092 r4112 12 12 13 13 #include <assert.h> 14 #include <errno.h> 14 15 #include <stdio.h> /* snprintf */ 16 #include <string.h> /* strerror */ 15 17 16 18 #include <miniupnp/miniwget.h> … … 88 90 { 89 91 struct UPNPDev * devlist = upnpDiscover( 2000, NULL ); 92 errno = 0; 90 93 if( UPNP_GetValidIGD( devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr))) { 91 94 tr_inf( KEY "found Internet Gateway Device '%s'", handle->urls.controlURL ); … … 95 98 } else { 96 99 handle->state = TR_UPNP_ERR; 100 tr_err( KEY "UPNP_GetValidIGD failed. (errno %d - %s)", errno, strerror(errno) ); 97 101 } 98 102 freeUPNPDevlist( devlist ); … … 129 133 char portStr[16]; 130 134 snprintf( portStr, sizeof(portStr), "%d", port ); 135 errno = 0; 131 136 handle->isMapped = ( handle->urls.controlURL != NULL ) && 132 137 ( handle->data.servicetype != NULL ) && … … 142 147 handle->state = TR_UPNP_IDLE; 143 148 } else { 144 tr_err( KEY "port forwarding failed ");149 tr_err( KEY "port forwarding failed (errno %d - %s)", errno, strerror(errno) ); 145 150 handle->port = -1; 146 151 handle->state = TR_UPNP_ERR;
Note: See TracChangeset
for help on using the changeset viewer.