From 6f8cef248e1467595a932707eb9a9c53af2e8839 Mon Sep 17 00:00:00 2001 From: oroborus Date: Fri, 30 May 2008 17:03:33 +0000 Subject: - opravene memory leaky pomocou vlagrindu - sietovy protokol je navrhnuty tal aby client odsiselal info o tom, ze obdrzal spravu git-svn-id: http://opensvn.csie.org/tuxanci_ng@57 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/client.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/client.c') diff --git a/src/client.c b/src/client.c index c770f3c..2d98790 100644 --- a/src/client.c +++ b/src/client.c @@ -88,6 +88,13 @@ void sendServer(char *msg) assert( msg != NULL ); +#ifndef PUBLIC_SERVER + if( isParamFlag("--send") ) + { + printf("send -> %s", msg); + } +#endif + #ifdef SUPPORT_NET_UNIX_UDP ret = writeUdpSocket(sock_server_udp, sock_server_udp, msg, strlen(msg)); #endif @@ -95,10 +102,6 @@ void sendServer(char *msg) #ifdef SUPPORT_NET_SDL_UDP ret = writeSdlUdpSocket(sock_server_sdl_udp, sock_server_sdl_udp, msg, strlen(msg)); #endif - -#ifdef DEBUG_CLIENT_SEND - printf("send server msg->%s", msg); -#endif } static int eventServerSelect() @@ -141,10 +144,12 @@ void eventServerBuffer() while ( getBufferLine(clientBuffer, line, STR_PROTO_SIZE) >= 0 ) { -#ifdef DEBUG_CLIENT_RECV +#ifndef PUBLIC_SERVER + if( isParamFlag("--recv") ) + { + printf("recv -> %s", line); + } #endif - printf("recv server msg->%s", line); - if( strncmp(line, "error", 5) == 0 )proto_recv_error_client(line); if( strncmp(line, "init", 4) == 0 )proto_recv_init_client(line); if( strncmp(line, "event", 5) == 0 )proto_recv_event_client(line); @@ -163,7 +168,6 @@ void eventServerBuffer() } } - void eventPingServer() { my_time_t currentTime; -- cgit v1.2.3