Changeset 4112


Ignore:
Timestamp:
Dec 9, 2007, 5:50:05 PM (14 years ago)
Author:
charles
Message:

added more upnp debugging messages for Chinstrap_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/upnp.c

    r4092 r4112  
    1212
    1313#include <assert.h>
     14#include <errno.h>
    1415#include <stdio.h> /* snprintf */
     16#include <string.h> /* strerror */
    1517
    1618#include <miniupnp/miniwget.h>
     
    8890    {
    8991        struct UPNPDev * devlist = upnpDiscover( 2000, NULL );
     92        errno = 0;
    9093        if( UPNP_GetValidIGD( devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr))) {
    9194            tr_inf( KEY "found Internet Gateway Device '%s'", handle->urls.controlURL );
     
    9598        } else {
    9699            handle->state = TR_UPNP_ERR;
     100            tr_err( KEY "UPNP_GetValidIGD failed.  (errno %d - %s)", errno, strerror(errno) );
    97101        }
    98102        freeUPNPDevlist( devlist );
     
    129133        char portStr[16];
    130134        snprintf( portStr, sizeof(portStr), "%d", port );
     135        errno = 0;
    131136        handle->isMapped = ( handle->urls.controlURL != NULL ) &&
    132137                           ( handle->data.servicetype != NULL ) &&
     
    142147            handle->state = TR_UPNP_IDLE;
    143148        } else {
    144             tr_err( KEY "port forwarding failed" );
     149            tr_err( KEY "port forwarding failed (errno %d - %s)", errno, strerror(errno) );
    145150            handle->port = -1;
    146151            handle->state = TR_UPNP_ERR;
Note: See TracChangeset for help on using the changeset viewer.