summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rwxr-xr-xserver/server/config.cpp14
-rwxr-xr-xserver/server/config.h7
-rwxr-xr-xserver/server/main.cpp7
3 files changed, 21 insertions, 7 deletions
diff --git a/server/server/config.cpp b/server/server/config.cpp
index 40ff3fb..b3e494a 100755
--- a/server/server/config.cpp
+++ b/server/server/config.cpp
@@ -80,6 +80,7 @@ void config::load_vars()
vars.conn_time = get_int(cfg_str, "ConnectionTimeOut=", 60);
vars.dos_conn_count = get_int(cfg_str, "DosConnectionCount=", 100);
vars.debug = get_int(cfg_str, "Debug=", 0);
+ vars.raw_debug = get_int(cfg_str, "RawDebug=", 0);
vars.log_speed = get_int(cfg_str, "LogSpeed=", 0);
vars.bind_ip = get_string(cfg_str, "BindAddress=", "0.0.0.0");
vars.log_path = get_string(cfg_str, "LogPath=", "");
@@ -531,10 +532,6 @@ const int config::check_interval()
{
return vars.check_interval;
}
-const int config::debug()
-{
- return vars.debug;
-}
const int config::dos_conn_count()
{
return vars.dos_conn_count;
@@ -577,6 +574,15 @@ bool config::ignore_ssl_errors()
{
return vars.ignore_ssl_errors;
}
+bool config::debug()
+{
+ return vars.debug;
+}
+
+bool config::raw_debug()
+{
+ return vars.raw_debug;
+}
bool config::log_speed()
{
diff --git a/server/server/config.h b/server/server/config.h
index 40f5985..2b37cbf 100755
--- a/server/server/config.h
+++ b/server/server/config.h
@@ -156,7 +156,6 @@ public:
const int config_reload_interval();
const int proxy_check_interval();
const int check_interval();
- const int debug();
const int dos_conn_count();
std::list<std::string>* cli_cfg();
void load_vars();
@@ -168,6 +167,8 @@ public:
void load_deleted_list(char* pth = NULL);
void load_servers_list(char* pth = NULL);
bool ignore_ssl_errors();
+ bool debug();
+ bool raw_debug();
bool log_speed();
const std::string& bind_ip();
const std::string& log_path();
@@ -192,10 +193,10 @@ private:
struct cfg_data
{
int ban_time, conn_count, check_interval, dos_conn_count, conn_time, config_reload_interval, proxy_check_interval;
- bool ignore_ssl_errors, log_speed, debug;
+ bool ignore_ssl_errors, log_speed, debug, raw_debug;
std::string log_path, bind_ip, dos_log_path, speed_test_file_url;
cfg_data(): ban_time(60), check_interval(30), dos_conn_count(200), conn_time(60), config_reload_interval(600), proxy_check_interval(3600),
- ignore_ssl_errors(false), log_speed(false), debug(false)
+ ignore_ssl_errors(false), log_speed(false), debug(false), raw_debug(false)
{}
};
std::string config_path, cli_config_path;
diff --git a/server/server/main.cpp b/server/server/main.cpp
index 5eb43c4..422ee79 100755
--- a/server/server/main.cpp
+++ b/server/server/main.cpp
@@ -512,6 +512,13 @@ void session::proto_parser(std::vector<byte>& data)
lists_mutex.unlock();
data.push_back(0x14);
data.push_back(0x14);
+ if(cfg->raw_debug())
+ {
+ logger->lock();
+ *logger<< time_str() << ": raw packet "<<data<<"\n";
+ logger->unlock();
+ }
+
write_w_response(data);
}
else