Skip to content

Commit

Permalink
fix cmake compile
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Nov 29, 2024
1 parent 4c0f7b3 commit d13c1be
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ set(SOURCE_FILES
framework/platform/unixplatform.cpp
framework/platform/win32crashhandler.cpp
framework/platform/win32platform.cpp
framework/proxy/proxy.cpp
framework/proxy/proxy_client.cpp
framework/stdext/demangle.cpp
framework/stdext/math.cpp
framework/stdext/net.cpp
Expand All @@ -301,6 +299,8 @@ set(SOURCE_FILES
framework/stdext/qrcodegen.cpp
framework/util/color.cpp
framework/util/crypt.cpp
framework/proxy/proxy.cpp
framework/proxy/proxy_client.cpp

client/animatedtext.cpp
client/animator.cpp
Expand Down
6 changes: 3 additions & 3 deletions src/framework/proxy/proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/

#include "proxy.h"
#include <framework/global.h>
#include <framework/stdext/stdext.h>

#include "proxy_client.h"

ProxyManager g_proxy;

Expand Down Expand Up @@ -177,4 +177,4 @@ int ProxyManager::getPing()
}
}
return ret;
}
}
12 changes: 9 additions & 3 deletions src/framework/proxy/proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@

#pragma once

#include "proxy_client.h"
#include <asio.hpp>

class ProxyManager {
class Proxy;
class Session;

using ProxyPacket = std::vector<uint8_t>;
using ProxyPacketPtr = std::shared_ptr<ProxyPacket>;

class ProxyManager
{
public:
ProxyManager() : m_io(), m_guard(asio::make_work_guard(m_io))
{

}
void init();
void terminate();
Expand Down
4 changes: 0 additions & 4 deletions src/framework/proxy/proxy_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@

//#define PROXY_DEBUG

#include <iostream>
#include <sstream>
#include <framework/global.h>

#include "proxy_client.h"

std::map<uint32_t, std::weak_ptr<Session>> g_sessions;
Expand Down
24 changes: 6 additions & 18 deletions src/framework/proxy/proxy_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@

#pragma once

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x501
#endif

#include <chrono>
#include <cstdint>
#include <functional>
#include <list>
#include <map>
#include <memory>
#include <random>
#include <set>
#include <string>
#include <thread>
#include <vector>
#include <asio.hpp>

using ProxyPacket = std::vector<uint8_t>;
Expand All @@ -45,10 +30,12 @@ using ProxyPacketPtr = std::shared_ptr<ProxyPacket>;
class Session;
using SessionPtr = std::shared_ptr<Session>;

class Proxy : public std::enable_shared_from_this<Proxy> {
class Proxy : public std::enable_shared_from_this<Proxy>
{
static constexpr int CHECK_INTERVAL = 2500; // also timeout for ping
static constexpr int BUFFER_SIZE = 65535;
enum ProxyState {
enum ProxyState
{
STATE_NOT_CONNECTED,
STATE_CONNECTING,
STATE_CONNECTING_WAIT_FOR_PING,
Expand Down Expand Up @@ -126,7 +113,8 @@ class Proxy : public std::enable_shared_from_this<Proxy> {

using ProxyPtr = std::shared_ptr<Proxy>;

class Session : public std::enable_shared_from_this<Session> {
class Session : public std::enable_shared_from_this<Session>
{
static constexpr int CHECK_INTERVAL = 500;
static constexpr int BUFFER_SIZE = 65535;
static constexpr int TIMEOUT = 30000;
Expand Down

0 comments on commit d13c1be

Please sign in to comment.