mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Include system info in the HTTP user agent on Windows
This commit is contained in:
parent
1b5b6fe692
commit
cd7e8372f3
3 changed files with 52 additions and 22 deletions
|
@ -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 _WIN32
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
#include "jthread/jevent.h"
|
||||
#include "config.h"
|
||||
#include "exceptions.h"
|
||||
|
@ -50,15 +47,7 @@ HTTPFetchRequest::HTTPFetchRequest()
|
|||
timeout = g_settings->getS32("curl_timeout");
|
||||
connect_timeout = timeout * 5;
|
||||
|
||||
useragent = std::string("Minetest/") + minetest_version_hash + " ";
|
||||
#ifdef _WIN32
|
||||
useragent += "(Windows)";
|
||||
#else
|
||||
struct utsname osinfo;
|
||||
uname(&osinfo);
|
||||
useragent += std::string("(") + osinfo.sysname + "/"
|
||||
+ osinfo.release + " " + osinfo.machine + ")";
|
||||
#endif
|
||||
useragent = std::string("Minetest/") + minetest_version_hash + " (" + porting::get_sysinfo() + ")";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue