]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/httpfetch.cpp
Revert "Fix settings to honor numeric conversion errors"
[dragonfireclient.git] / src / httpfetch.cpp
index 3d944735876234645d046de772f2881027fdc215..2eca363d7bb9a34bb415a431cc2df00ddedd8d30 100644 (file)
@@ -18,16 +18,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "socket.h" // for select()
-#include "porting.h" // for sleep_ms()
+#include "porting.h" // for sleep_ms(), get_sysinfo()
 #include "httpfetch.h"
 #include <iostream>
 #include <sstream>
 #include <list>
 #include <map>
 #include <errno.h>
-#ifndef _MSC_VER
-#include <sys/utsname.h>
-#endif
 #include "jthread/jevent.h"
 #include "config.h"
 #include "exceptions.h"
@@ -42,23 +39,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 JMutex g_httpfetch_mutex;
 std::map<unsigned long, std::list<HTTPFetchResult> > g_httpfetch_results;
 
-       HTTPFetchRequest::HTTPFetchRequest()
-       {
-               url = "";
-               caller = HTTPFETCH_DISCARD;
-               request_id = 0;
-               timeout = g_settings->getS32("curl_timeout");
-               connect_timeout = timeout * 5;
-               
-               useragent = std::string("Minetest ") + minetest_version_hash;
-#ifdef _MSC_VER
-               useragent += "Windows";
-#else
-               struct utsname osinfo;
-               uname(&osinfo);
-               useragent += std::string(" (") + osinfo.sysname + "; " + osinfo.release + "; " + osinfo.machine + ")";
-#endif
-       }
+HTTPFetchRequest::HTTPFetchRequest()
+{
+       url = "";
+       caller = HTTPFETCH_DISCARD;
+       request_id = 0;
+       timeout = g_settings->getS32("curl_timeout");
+       connect_timeout = timeout * 5;
+       
+       useragent = std::string("Minetest/") + minetest_version_hash + " (" + porting::get_sysinfo() + ")";
+}
 
 
 static void httpfetch_deliver_result(const HTTPFetchResult &fetchresult)