]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/HTTPFileRequest.cxx
Remove SVN sync code.
[simgear.git] / simgear / io / HTTPFileRequest.cxx
index 33b7339a78185c9631290ddfdaafc18dbf158ab8..460216252ff897a492d74c518d10791cf697c0a2 100644 (file)
@@ -38,12 +38,15 @@ namespace HTTP
   {
     Request::responseHeadersComplete();
 
+    if( responseCode() != 200 )
+      return setFailure(responseCode(), responseReason());
+
     if( !_filename.empty() )
     {
       // TODO validate path? (would require to expose fgValidatePath somehow to
       //      simgear)
       SGPath path(_filename);
-      path.create_dir(0777);
+      path.create_dir(0755);
 
       _file.open(_filename.c_str(), std::ios::binary | std::ios::trunc);
     }
@@ -56,8 +59,6 @@ namespace HTTP
         SG_WARN,
         "HTTP::FileRequest: failed to open file '" << _filename << "'"
       );
-
-      abort("Failed to open file.");
     }
   }
 
@@ -69,8 +70,8 @@ namespace HTTP
       SG_LOG
       (
         SG_IO,
-        SG_WARN,
-        "HTTP::FileRequest: error writing to '" << _filename << "'"
+        SG_DEBUG,
+        "HTTP::FileRequest: received data for closed file '" << _filename << "'"
       );
       return;
     }