diff options
author | ArvidNorr <norrarvid@gmail.com> | 2013-01-18 10:24:25 +0100 |
---|---|---|
committer | ArvidNorr <norrarvid@gmail.com> | 2013-01-18 10:24:25 +0100 |
commit | 975d44e99f21e9bb9249ecb5bdc81122c3bc63be (patch) | |
tree | 7de3ba47d4986e3b38b105c7fa456e85125a5878 /common | |
parent | ffc7e7ff270134c7f5c73f8f86cac81038e8fee3 (diff) | |
download | xrdp-proprietary-975d44e99f21e9bb9249ecb5bdc81122c3bc63be.tar.gz xrdp-proprietary-975d44e99f21e9bb9249ecb5bdc81122c3bc63be.zip |
More logging added
Diffstat (limited to 'common')
-rw-r--r-- | common/os_calls.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/common/os_calls.c b/common/os_calls.c index 07f378e5..a3daaa3a 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -60,6 +60,7 @@ #include "os_calls.h" #include "arch.h" +#include "log.h" /* for clearenv() */ #if defined(_WIN32) @@ -493,6 +494,7 @@ g_tcp_local_socket(void) void APP_CC g_tcp_close(int sck) { + char ip[256] ; if (sck == 0) { return; @@ -501,6 +503,8 @@ g_tcp_close(int sck) #if defined(_WIN32) closesocket(sck); #else + g_write_ip_address(sck,ip,256); + log_message(LOG_LEVEL_INFO,"An established connection closed to endpoint: %s", ip); close(sck); #endif } @@ -636,6 +640,8 @@ g_tcp_listen(int sck) int APP_CC g_tcp_accept(int sck) { + int ret ; + char ipAddr[256] ; struct sockaddr_in s; #if defined(_WIN32) signed int i; @@ -645,7 +651,14 @@ g_tcp_accept(int sck) i = sizeof(struct sockaddr_in); memset(&s, 0, i); - return accept(sck, (struct sockaddr *)&s, &i); + ret = accept(sck, (struct sockaddr *)&s, &i); + if(ret>0) + { + snprintf(ipAddr,256,"A connection received from: %s port %d" + ,inet_ntoa(s.sin_addr),ntohs(s.sin_port)); + log_message(LOG_LEVEL_INFO,ipAddr); + } + return ret ; } /*****************************************************************************/ |