]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/HTTPRequest.cxx
Ensure individual log-level setting works.
[simgear.git] / simgear / io / HTTPRequest.cxx
index 0e789e5ce3920c9ddbed5ac48afa82b75689981b..ce706957b6f45469b4213b9f2c6244f462830fc9 100644 (file)
@@ -112,8 +112,10 @@ string Request::path() const
     }
     
     int hostEnd = u.find('/', schemeEnd + 3);
-    if (hostEnd < 0) { 
-        return ""; // couldn't parse host
+    if (hostEnd < 0) {
+// couldn't parse host, or URL looks like 'http://foo.com' (no trailing '/') 
+// fixup to root resource path: '/' 
+        return "/"; 
     }
     
     int query = u.find('?', hostEnd + 1);
@@ -203,6 +205,7 @@ void Request::setFailure(int code, const std::string& reason)
 void Request::failed()
 {
     // no-op in base class
+    SG_LOG(SG_IO, SG_INFO, "request failed:" << url());
 }
 
 Request::HTTPVersion Request::decodeVersion(const string& v)