Ignore:
Timestamp:
May 1, 2010, 4:21:41 AM (11 years ago)
Author:
charles
Message:

(1.9x third-party) upgrade our miniupnp snapshot for #3125 "UPnP fails on Linksys AM300 modem/router"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.9x/third-party/miniupnp/igd_desc_parse.c

    r10285 r10578  
    1 /* $Id: igd_desc_parse.c,v 1.9 2009/12/03 13:50:06 nanard Exp $ */
     1/* $Id: igd_desc_parse.c,v 1.10 2010/04/05 20:36:59 nanard Exp $ */
    22/* Project : miniupnp
    33 * http://miniupnp.free.fr/
    44 * Author : Thomas Bernard
    5  * Copyright (c) 2005-2008 Thomas Bernard
     5 * Copyright (c) 2005-2010 Thomas Bernard
    66 * This software is subject to the conditions detailed in the
    7  * LICENCE file provided in this distribution.
    8  * */
     7 * LICENCE file provided in this distribution. */
     8
    99#include "igd_desc_parse.h"
    1010#include <stdio.h>
    1111#include <string.h>
    12 
    13 /* TODO : rewrite this code so it correctly handle descriptions with
    14  * both WANIPConnection and/or WANPPPConnection */
    1512
    1613/* Start element handler :
     
    2320        datas->level++;
    2421        if( (l==7) && !memcmp(name, "service", l) ) {
    25                 datas->controlurl_tmp[0] = '\0';
    26                 datas->eventsuburl_tmp[0] = '\0';
    27                 datas->scpdurl_tmp[0] = '\0';
    28                 datas->servicetype_tmp[0] = '\0';
     22                datas->tmp.controlurl[0] = '\0';
     23                datas->tmp.eventsuburl[0] = '\0';
     24                datas->tmp.scpdurl[0] = '\0';
     25                datas->tmp.servicetype[0] = '\0';
    2926        }
    3027}
     
    4744                        datas->state ++;
    4845                */
    49                 if(0==strcmp(datas->servicetype_tmp,
     46                if(0==strcmp(datas->tmp.servicetype,
    5047                                "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1")) {
    51                         memcpy(datas->controlurl_CIF, datas->controlurl_tmp, MINIUPNPC_URL_MAXSIZE);
    52                         memcpy(datas->eventsuburl_CIF, datas->eventsuburl_tmp, MINIUPNPC_URL_MAXSIZE);
    53                         memcpy(datas->scpdurl_CIF, datas->scpdurl_tmp, MINIUPNPC_URL_MAXSIZE);
    54                         memcpy(datas->servicetype_CIF, datas->servicetype_tmp, MINIUPNPC_URL_MAXSIZE);
    55                 } else if(0==strcmp(datas->servicetype_tmp,
     48                        memcpy(&datas->CIF, &datas->tmp, sizeof(struct IGDdatas_service));
     49                } else if(0==strcmp(datas->tmp.servicetype,
    5650                                "urn:schemas-upnp-org:service:WANIPConnection:1")
    57                                  || 0==strcmp(datas->servicetype_tmp,
     51                                 || 0==strcmp(datas->tmp.servicetype,
    5852                                "urn:schemas-upnp-org:service:WANPPPConnection:1") ) {
    59                         memcpy(datas->controlurl, datas->controlurl_tmp, MINIUPNPC_URL_MAXSIZE);
    60                         memcpy(datas->eventsuburl, datas->eventsuburl_tmp, MINIUPNPC_URL_MAXSIZE);
    61                         memcpy(datas->scpdurl, datas->scpdurl_tmp, MINIUPNPC_URL_MAXSIZE);
    62                         memcpy(datas->servicetype, datas->servicetype_tmp, MINIUPNPC_URL_MAXSIZE);
     53                        if(datas->first.servicetype[0] == '\0') {
     54                                memcpy(&datas->first, &datas->tmp, sizeof(struct IGDdatas_service));
     55                        } else {
     56                                memcpy(&datas->second, &datas->tmp, sizeof(struct IGDdatas_service));
     57                        }
    6358                }
    6459        }
     
    7671                dstmember = datas->urlbase;
    7772        else if( !strcmp(datas->cureltname, "serviceType") )
    78                 dstmember = datas->servicetype_tmp;
     73                dstmember = datas->tmp.servicetype;
    7974        else if( !strcmp(datas->cureltname, "controlURL") )
    80                 dstmember = datas->controlurl_tmp;
     75                dstmember = datas->tmp.controlurl;
    8176        else if( !strcmp(datas->cureltname, "eventSubURL") )
    82                 dstmember = datas->eventsuburl_tmp;
     77                dstmember = datas->tmp.eventsuburl;
    8378        else if( !strcmp(datas->cureltname, "SCPDURL") )
    84                 dstmember = datas->scpdurl_tmp;
     79                dstmember = datas->tmp.scpdurl;
    8580/*      else if( !strcmp(datas->cureltname, "deviceType") )
    8681                dstmember = datas->devicetype_tmp;*/
     
    9893        printf("urlbase = '%s'\n", d->urlbase);
    9994        printf("WAN Device (Common interface config) :\n");
    100         /*printf(" deviceType = '%s'\n", d->devicetype_CIF);*/
    101         printf(" serviceType = '%s'\n", d->servicetype_CIF);
    102         printf(" controlURL = '%s'\n", d->controlurl_CIF);
    103         printf(" eventSubURL = '%s'\n", d->eventsuburl_CIF);
    104         printf(" SCPDURL = '%s'\n", d->scpdurl_CIF);
     95        /*printf(" deviceType = '%s'\n", d->CIF.devicetype);*/
     96        printf(" serviceType = '%s'\n", d->CIF.servicetype);
     97        printf(" controlURL = '%s'\n", d->CIF.controlurl);
     98        printf(" eventSubURL = '%s'\n", d->CIF.eventsuburl);
     99        printf(" SCPDURL = '%s'\n", d->CIF.scpdurl);
    105100        printf("WAN Connection Device (IP or PPP Connection):\n");
    106         /*printf(" deviceType = '%s'\n", d->devicetype);*/
    107         printf(" servicetype = '%s'\n", d->servicetype);
    108         printf(" controlURL = '%s'\n", d->controlurl);
    109         printf(" eventSubURL = '%s'\n", d->eventsuburl);
    110         printf(" SCPDURL = '%s'\n", d->scpdurl);
     101        /*printf(" deviceType = '%s'\n", d->first.devicetype);*/
     102        printf(" servicetype = '%s'\n", d->first.servicetype);
     103        printf(" controlURL = '%s'\n", d->first.controlurl);
     104        printf(" eventSubURL = '%s'\n", d->first.eventsuburl);
     105        printf(" SCPDURL = '%s'\n", d->first.scpdurl);
     106        printf("secondary WAN Connection Device (IP or PPP Connection):\n");
     107        /*printf(" deviceType = '%s'\n", d->second.devicetype);*/
     108        printf(" servicetype = '%s'\n", d->second.servicetype);
     109        printf(" controlURL = '%s'\n", d->second.controlurl);
     110        printf(" eventSubURL = '%s'\n", d->second.eventsuburl);
     111        printf(" SCPDURL = '%s'\n", d->second.scpdurl);
    111112}
    112113
Note: See TracChangeset for help on using the changeset viewer.