diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-08-03 14:17:06 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-08-03 14:17:06 +0000 |
| commit | 00c9cebac684c42741e924d11038d5591e87dacd (patch) | |
| tree | a2056cbbf8ae0512ff15e9eb8868ceab29877073 /src/base/udp_server.c | |
| parent | 1a592767c6e34bdeb7f30fa063b5e24c57d45894 (diff) | |
- trochu rozsirena konfiguracvia, viz http://www.tuxanci.org/server/howto
- moznost logovat so suboru
git-svn-id: http://opensvn.csie.org/tuxanci_ng@188 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/base/udp_server.c')
| -rw-r--r-- | src/base/udp_server.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/base/udp_server.c b/src/base/udp_server.c index 63a24ea..e534975 100644 --- a/src/base/udp_server.c +++ b/src/base/udp_server.c @@ -36,6 +36,7 @@ #ifdef PUBLIC_SERVER #include "publicServer.h" #include "heightScore.h" +#include "log.h" #endif #include "udp.h" @@ -48,28 +49,37 @@ static sock_udp_t *sock_server_udp_second; client_t* newUdpClient(sock_udp_t *sock_udp) { client_t *new; - char str_ip[STR_IP_SIZE]; assert( sock_udp != NULL ); - getSockUdpIp(sock_udp, str_ip, STR_IP_SIZE); - printf("new client UDP from %s %d\n", str_ip, getSockUdpPort(sock_udp)); - - new = newAnyClient(); + new = newAnyClient(); new->type = CLIENT_TYPE_UDP; new->socket_udp = sock_udp; +#ifdef PUBLIC_SERVER + char str_log[STR_LOG_SIZE]; + char str_ip[STR_IP_SIZE]; + + getSockUdpIp(sock_udp, str_ip, STR_IP_SIZE); + sprintf(str_log, "new client UDP from %s %d", str_ip, getSockUdpPort(sock_udp)); + addToLog(LOG_INF, str_log); +#endif + return new; } void destroyUdpClient(client_t *p) { - char str_ip[STR_IP_SIZE]; - eventMsgInCheckFront(p); +#ifdef PUBLIC_SERVER + char str_log[STR_LOG_SIZE]; + char str_ip[STR_IP_SIZE]; + getSockUdpIp(p->socket_udp, str_ip, STR_IP_SIZE); - printf("close UDP connect %s %d\n", str_ip, getSockUdpPort(p->socket_udp) ); + sprintf(str_log, "close UDP connect %s %d", str_ip, getSockUdpPort(p->socket_udp)); + addToLog(LOG_INF, str_log); +#endif destroySockUdp(p->socket_udp); |