Switch to unified view

a/libupnpp/description.cxx b/libupnpp/description.cxx
...
...
113
113
114
    UPnPDeviceParser mparser(description, *this);
114
    UPnPDeviceParser mparser(description, *this);
115
    if (!mparser.Parse())
115
    if (!mparser.Parse())
116
        return;
116
        return;
117
    if (URLBase.empty()) {
117
    if (URLBase.empty()) {
118
        // The standard says that if the URLBase value is empty, we should use
118
        // The standard says that if the URLBase value is empty, we
119
      // the url the description was retrieved from. However this is
119
      // should use the url the description was retrieved
120
      // sometimes something like http://host/desc.xml, sometimes something
120
      // from. However this is sometimes something like
121
      // like http://host/
121
      // http://host/desc.xml, sometimes something like http://host/
122
122
      // (rare, but e.g. sent by the server on a dlink nas).
123
      if (url.size() < 8) {
124
          // ???
125
         URLBase = url;
123
        URLBase = baseurl(url);
126
      } else {
127
          string::size_type hostslash = url.find_first_of("/", 7);
128
          if (hostslash == string::npos || hostslash == url.size()-1) {
129
              URLBase = url;
130
          } else {
131
              URLBase = path_getfather(url);
132
          }
133
      }
134
    }
124
    }
135
    ok = true;
125
    ok = true;
136
    //cerr << "URLBase: [" << URLBase << "]" << endl;
126
    //cerr << "URLBase: [" << URLBase << "]" << endl;
137
    //cerr << dump() << endl;
127
    //cerr << dump() << endl;
138
}
128
}