]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/DAVMultiStatus.cxx
HTTP SVN fixes, cap max update-report depth.
[simgear.git] / simgear / io / DAVMultiStatus.cxx
index 54c23870ed0eb5e38d6665a0977a377d2a30d74f..6e1425dcc02c493fe3d13aced88e50010ab81bbc 100644 (file)
@@ -31,9 +31,6 @@
 #include "simgear/misc/strutils.hxx"
 #include "simgear/structure/exception.hxx"
 
-using std::cout;
-using std::cerr;
-using std::endl;
 using std::string;
 
 using namespace simgear;
@@ -61,7 +58,10 @@ DAVResource::DAVResource(const string& href) :
   _url(href),
   _container(NULL)
 {
-    assert(!href.empty()); 
+    assert(!href.empty());
+    if (strutils::ends_with(href, "/")) {
+        _url = href.substr(0, _url.size() - 1);
+    }
 }
 
 void DAVResource::setVersionName(const std::string& aVersion)
@@ -113,13 +113,6 @@ void DAVCollection::addChild(DAVResource *res)
   
   assert(res->container() == NULL);
   assert(std::find(_contents.begin(), _contents.end(), res) == _contents.end());
-  
-  if (!strutils::starts_with(res->url(), _url)) {
-      std::cerr << "us: " << _url << std::endl;
-      std::cerr << "child:" << res->url() << std::endl;
-      
-  }
-  
   assert(strutils::starts_with(res->url(), _url));
   assert(childWithUrl(res->url()) == NULL);
   
@@ -276,7 +269,7 @@ public:
   
   string tagN(const unsigned int n) const
   {
-    int sz = tagStack.size();
+    size_t sz = tagStack.size();
     if (n >= sz) {
       return string();
     }