From 91246c877139e6352eb90a5aa47874228d4d0a00 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Tue, 25 Feb 2020 18:28:37 +0800 Subject: [PATCH] remove some deprecated code --- src/client/client.c | 17 +++++++++++------ src/include/client.h | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/client/client.c b/src/client/client.c index 01fc1fe3..cefb05dc 100644 --- a/src/client/client.c +++ b/src/client/client.c @@ -90,8 +90,11 @@ ON_UNLOCK_CLIENT_REQ OnUnlockClientReq = NULL; #define TIMEOUT_START_REPEAT 20 #define TIMEOUT_REPEAT 10 -static struct timeval my_timeout; +#if 0 /* deprecated code */ +/* set the timer to 10ms can make the client respond more faster */ + +static struct timeval my_timeout; void __mg_set_select_timeout (unsigned int usec) { my_timeout.tv_sec = 0; @@ -108,10 +111,10 @@ void __mg_set_select_timeout (unsigned int usec) else { my_timeout.tv_usec = USEC_10MS * TIMEOUT_START_REPEAT; } -#else /* set the timer to 10ms can make the client respond more faster */ - my_timeout.tv_usec = USEC_10MS; #endif + my_timeout.tv_usec = USEC_10MS; } +#endif /* deprecated code */ BOOL client_ClientStartup (void) { @@ -124,7 +127,7 @@ BOOL client_ClientStartup (void) FD_SET (conn_fd, &__mg_dsk_msg_queue->rfdset); __mg_dsk_msg_queue->maxfd = conn_fd; - __mg_set_select_timeout (0); + // __mg_set_select_timeout (0); /* ignore the SIGPIPE signal */ siga.sa_handler = SIG_IGN; @@ -405,8 +408,10 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait) esetptr = &eset; } - if (wait) - sel_timeout = my_timeout; + if (wait) { + sel_timeout.tv_sec = 0; + sel_timeout.tv_usec = USEC_10MS; + } else { /* check fd only: for HavePendingMessage function */ sel_timeout.tv_sec = 0; sel_timeout.tv_usec = 0; diff --git a/src/include/client.h b/src/include/client.h index 27da9a4a..8f783bbc 100644 --- a/src/include/client.h +++ b/src/include/client.h @@ -325,7 +325,7 @@ static inline int ClientRequest (const REQUEST* request, } #endif /* not defined _MGUI_MINIGUI_H */ -void __mg_set_select_timeout (unsigned int usec); +//void __mg_set_select_timeout (unsigned int usec); void __mg_start_client_desktop (void); void __mg_update_window (HWND hwnd, int left, int top, int right, int bottom);