diff options
Diffstat (limited to 'sesman/libscp/libscp_session.c')
-rw-r--r-- | sesman/libscp/libscp_session.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/sesman/libscp/libscp_session.c b/sesman/libscp/libscp_session.c index 8ac94d25..244f188a 100644 --- a/sesman/libscp/libscp_session.c +++ b/sesman/libscp/libscp_session.c @@ -31,7 +31,7 @@ #include <sys/socket.h> #include <arpa/inet.h> -extern struct log_config* s_log; +//extern struct log_config* s_log; /*******************************************************************/ struct SCP_SESSION* @@ -42,7 +42,7 @@ scp_session_create() s = (struct SCP_SESSION*)g_malloc(sizeof(struct SCP_SESSION), 1); if (0 == s) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] session create: malloc error", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] session create: malloc error", __LINE__); return 0; } return s; @@ -65,12 +65,12 @@ scp_session_set_type(struct SCP_SESSION* s, tui8 type) s->mng = (struct SCP_MNG_DATA*)g_malloc(sizeof(struct SCP_MNG_DATA), 1); if (NULL == s->mng) { - log_message(s_log, LOG_LEVEL_ERROR, "[session:%d] set_type: internal error", __LINE__); + log_message(LOG_LEVEL_ERROR, "[session:%d] set_type: internal error", __LINE__); return 1; } break; default: - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_type: unknown type", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_type: unknown type", __LINE__); return 1; } return 0; @@ -89,7 +89,7 @@ scp_session_set_version(struct SCP_SESSION* s, tui32 version) s->version = 1; break; default: - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_version: unknown version", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_version: unknown version", __LINE__); return 1; } return 0; @@ -149,7 +149,7 @@ scp_session_set_locale(struct SCP_SESSION* s, char* str) { if (0 == str) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_locale: null locale", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_locale: null locale", __LINE__); s->locale[0]='\0'; return 1; } @@ -164,7 +164,7 @@ scp_session_set_username(struct SCP_SESSION* s, char* str) { if (0 == str) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_username: null username", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_username: null username", __LINE__); return 1; } if (0 != s->username) @@ -174,7 +174,7 @@ scp_session_set_username(struct SCP_SESSION* s, char* str) s->username = g_strdup(str); if (0 == s->username) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_username: strdup error", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_username: strdup error", __LINE__); return 1; } return 0; @@ -186,7 +186,7 @@ scp_session_set_password(struct SCP_SESSION* s, char* str) { if (0 == str) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_password: null password", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_password: null password", __LINE__); return 1; } if (0 != s->password) @@ -196,7 +196,7 @@ scp_session_set_password(struct SCP_SESSION* s, char* str) s->password = g_strdup(str); if (0 == s->password) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_password: strdup error", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_password: strdup error", __LINE__); return 1; } return 0; @@ -208,7 +208,7 @@ scp_session_set_domain(struct SCP_SESSION* s, char* str) { if (0 == str) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_domain: null domain", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_domain: null domain", __LINE__); return 1; } if (0 != s->domain) @@ -218,7 +218,7 @@ scp_session_set_domain(struct SCP_SESSION* s, char* str) s->domain = g_strdup(str); if (0 == s->domain) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_domain: strdup error", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_domain: strdup error", __LINE__); return 1; } return 0; @@ -230,7 +230,7 @@ scp_session_set_program(struct SCP_SESSION* s, char* str) { if (0 == str) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_program: null program", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_program: null program", __LINE__); return 1; } if (0 != s->program) @@ -240,7 +240,7 @@ scp_session_set_program(struct SCP_SESSION* s, char* str) s->program = g_strdup(str); if (0 == s->program) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_program: strdup error", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_program: strdup error", __LINE__); return 1; } return 0; @@ -252,7 +252,7 @@ scp_session_set_directory(struct SCP_SESSION* s, char* str) { if (0 == str) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_directory: null directory", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_directory: null directory", __LINE__); return 1; } if (0 != s->directory) @@ -262,7 +262,7 @@ scp_session_set_directory(struct SCP_SESSION* s, char* str) s->directory = g_strdup(str); if (0 == s->directory) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_directory: strdup error", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_directory: strdup error", __LINE__); return 1; } return 0; @@ -274,7 +274,7 @@ scp_session_set_client_ip(struct SCP_SESSION* s, char* str) { if (0 == str) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_client_ip: null ip", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_client_ip: null ip", __LINE__); return 1; } if (0 != s->client_ip) @@ -284,7 +284,7 @@ scp_session_set_client_ip(struct SCP_SESSION* s, char* str) s->client_ip = g_strdup(str); if (0 == s->client_ip) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_client_ip: strdup error", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_client_ip: strdup error", __LINE__); return 1; } return 0; @@ -296,7 +296,7 @@ scp_session_set_hostname(struct SCP_SESSION* s, char* str) { if (0 == str) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_hostname: null hostname", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_hostname: null hostname", __LINE__); return 1; } if (0 != s->hostname) @@ -306,7 +306,7 @@ scp_session_set_hostname(struct SCP_SESSION* s, char* str) s->hostname = g_strdup(str); if (0 == s->hostname) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_hostname: strdup error", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_hostname: strdup error", __LINE__); return 1; } return 0; @@ -318,7 +318,7 @@ scp_session_set_errstr(struct SCP_SESSION* s, char* str) { if (0 == str) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_errstr: null string", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_errstr: null string", __LINE__); return 1; } if (0 != s->errstr) @@ -328,7 +328,7 @@ scp_session_set_errstr(struct SCP_SESSION* s, char* str) s->errstr = g_strdup(str); if (0 == s->errstr) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_errstr: strdup error", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_errstr: strdup error", __LINE__); return 1; } return 0; @@ -359,7 +359,7 @@ scp_session_set_addr(struct SCP_SESSION* s, int type, void* addr) ret = inet_pton(AF_INET, addr, &ip4); if (ret == 0) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_addr: invalid address", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_addr: invalid address", __LINE__); inet_pton(AF_INET, "127.0.0.1", &ip4); g_memcpy(&(s->ipv4addr), &(ip4.s_addr), 4); return 1; @@ -375,7 +375,7 @@ scp_session_set_addr(struct SCP_SESSION* s, int type, void* addr) ret = inet_pton(AF_INET6, addr, &ip6); if (ret == 0) { - log_message(s_log, LOG_LEVEL_WARNING, "[session:%d] set_addr: invalid address", __LINE__); + log_message(LOG_LEVEL_WARNING, "[session:%d] set_addr: invalid address", __LINE__); inet_pton(AF_INET, "::1", &ip6); g_memcpy(s->ipv6addr, &(ip6.s6_addr), 16); return 1; |