]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/httpget.cxx
Use the original filename for the compressed image message.
[simgear.git] / simgear / io / httpget.cxx
index a8e226066a7bbf2f67d6e8496a82ce9f3844c96b..3b0506c5889047c708709a8707760135c6f3bcce 100644 (file)
@@ -1,18 +1,18 @@
 
 #include <cstdio>
 #include <cstring>
+#include <signal.h>
 
-#include <unistd.h> // for STDOUT_FILENO
 #include <iostream>
 #include <boost/foreach.hpp>
-#include <signal.h>
+
 
 #include <simgear/io/sg_file.hxx>
 #include <simgear/io/HTTPClient.hxx>
 #include <simgear/io/HTTPRequest.hxx>
 #include <simgear/io/sg_netChannel.hxx>
 #include <simgear/misc/strutils.hxx>
-#include <simgear/misc/sg_sleep.hxx>
+#include <simgear/timing/timestamp.hxx>
 
 using namespace simgear;
 using std::cout;
@@ -94,7 +94,7 @@ private:
 int main(int argc, char* argv[])
 {
     HTTP::Client cl;
-    SGFile* outFile;
+    SGFile* outFile = 0;
     string proxy, proxyAuth;
     string_list headers;
     string url;
@@ -133,10 +133,12 @@ int main(int argc, char* argv[])
         cl.setProxy(proxyHost, proxyPort, proxyAuth);
     }
 
+#ifndef WIN32
     signal(SIGPIPE, SIG_IGN);
+#endif
 
     if (!outFile) {
-        outFile = new SGFile(STDOUT_FILENO);
+        outFile = new SGFile(fileno(stdout));
     }
 
     if (url.empty()) {
@@ -154,7 +156,7 @@ int main(int argc, char* argv[])
     
     while (!req->complete()) {
         cl.update();
-        sleepForMSec(100);
+        SGTimeStamp::sleepForMSec(100);
     }
         
     if (req->responseCode() != 200) {