修复释放问题

This commit is contained in:
xx
2024-06-01 16:36:25 +08:00
parent 91e232deb4
commit 2fc5b23f86
12 changed files with 55 additions and 37 deletions

View File

@@ -47,6 +47,7 @@ namespace ylib
cdn();
~cdn();
bool start(const cdn_config& config);
void close();
std::string host();
virtual bool run() override;
const cdn_config& config() { return m_config; }

View File

@@ -29,6 +29,7 @@ namespace ylib
~interceptor();
size_t add(const std::string& regex_express, std::function<bool(network::http::reqpack* rp,const std::string& express)> callback);
bool trigger(const std::string& url, network::http::reqpack* rp);
void clear();
private:
ylib::nolock_array<interceptor_info*> m_array;
};

View File

@@ -109,14 +109,11 @@ namespace ylib
std::string path,
network::http::method method
);
#if HTTP_LUA_ENGINE == 1
void subscribe(
const std::string& lua_filepath,
std::string path,
network::http::method method,
std::function<void(sol::state& state)> init_state = nullptr
);
#endif
/// <summary>
/// 清理所有订阅
/// </summary>
void clear_subscribe();
/******************************************************************
* function其它
* desc未订阅请求触发该回调

View File

@@ -49,17 +49,17 @@ namespace ylib
ylib::nolock_array<network::http::proxy*>* proxy();
private:
// 文件缓存
network::http::cache* m_cache;
network::http::cache* m_cache = nullptr;
// SESSION缓存
ylib::local_storage* m_session_local_storage;
ylib::local_storage* m_session_local_storage = nullptr;
// router路由 服务
network::http::router* m_router;
network::http::router* m_router = nullptr;
// CDN服务
network::http::cdn* m_cdn;
network::http::cdn* m_cdn = nullptr;
// HOST
std::vector<network::http::host*> m_hosts;
// HTTPS
bool m_https;
bool m_https = false;
// 反向代理
ylib::nolock_array<network::http::proxy*> m_proxy;
// 配置

View File

@@ -45,7 +45,7 @@ namespace ylib
}
return m_array[index];
}
inline size_t size() { return m_count; }
T* m_array;
size_t m_count;
};

View File

@@ -3,6 +3,7 @@
#include <vector>
#include "util/json.h"
#include "util/counter.hpp"
#include "base/error.h"
namespace leveldb
{
class DB;
@@ -12,7 +13,7 @@ namespace ylib
/// <summary>
/// 本地存储(LevelDB)
/// </summary>
class local_storage
class local_storage:public ylib::error_base
{
public:
local_storage();