mirror of
https://github.com/xmrig/xmrig.git
synced 2026-01-31 01:22:53 -05:00
Update user agent for macOS and fix compile warnings
This commit is contained in:
@@ -36,7 +36,14 @@ char *xmrig::Platform::createUserAgent()
|
||||
constexpr const size_t max = 256;
|
||||
|
||||
char *buf = new char[max]();
|
||||
int length = snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s", APP_NAME, APP_VERSION, uv_version_string());
|
||||
int length = snprintf(buf, max,
|
||||
"%s/%s (Macintosh; macOS"
|
||||
# ifdef XMRIG_ARM
|
||||
"; arm64"
|
||||
# else
|
||||
"; x86_64"
|
||||
# endif
|
||||
") libuv/%s", APP_NAME, APP_VERSION, uv_version_string());
|
||||
|
||||
# ifdef __clang__
|
||||
length += snprintf(buf + length, max - length, " clang/%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__);
|
||||
|
||||
@@ -29,13 +29,20 @@ namespace xmrig {
|
||||
class HttpListener : public IHttpListener
|
||||
{
|
||||
public:
|
||||
inline HttpListener(IHttpListener *listener, const char *tag = nullptr) : m_tag(tag), m_listener(listener) {}
|
||||
inline HttpListener(IHttpListener *listener, const char *tag = nullptr) :
|
||||
# ifdef APP_DEBUG
|
||||
m_tag(tag),
|
||||
# endif
|
||||
m_listener(listener)
|
||||
{}
|
||||
|
||||
protected:
|
||||
void onHttpData(const HttpData &data) override;
|
||||
|
||||
private:
|
||||
# ifdef APP_DEBUG
|
||||
const char *m_tag;
|
||||
# endif
|
||||
IHttpListener *m_listener;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user