Changeset 1693


Ignore:
Timestamp:
Apr 9, 2007, 11:06:28 PM (15 years ago)
Author:
joshe
Message:

Fix UPnP for vendors which specify relative paths and no urlbase.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/upnp.c

    r1579 r1693  
    122122devicePulseGetHttp( tr_upnp_device_t * dev );
    123123static int
    124 parseRoot( const char *buf, int len, char ** soap, char ** scpd );
     124parseRoot( const char * root, const char *buf, int len,
     125           char ** soap, char ** scpd );
    125126static void
    126127addUrlbase( const char * base, char ** path );
     
    665666                        dev->host, code );
    666667            }
    667             else if( parseRoot( body, len, &dev->soap, &dev->scpd ) )
     668            else if( parseRoot( dev->root, body, len,
     669                                &dev->soap, &dev->scpd ) )
    668670            {
    669671                tr_dbg( "upnp device %s: parse root failed", dev->host );
     
    942944
    943945static int
    944 parseRoot(const char *buf, int len, char ** soap, char ** scpd )
     946parseRoot( const char * root, const char *buf, int len,
     947           char ** soap, char ** scpd )
    945948{
    946949    const char * end, * ii, * jj, * kk, * urlbase;
     
    9991002    }
    10001003
    1001     basedup = tr_xmlDupContents( urlbase, end );
     1004    if( NULL == urlbase )
     1005    {
     1006        basedup = strrchr( root, '/' );
     1007        assert( NULL != basedup );
     1008        basedup = tr_dupstr( root, basedup - root + 1 );
     1009    }
     1010    else
     1011    {
     1012        basedup = tr_xmlDupContents( urlbase, end );
     1013    }
    10021014    addUrlbase( basedup, soap );
    10031015    addUrlbase( basedup, scpd );
Note: See TracChangeset for help on using the changeset viewer.