From: Dave Hart Date: Wed, 5 Oct 2011 08:34:46 +0000 (+0000) Subject: Keep add_full_recv_buffer() and SetEvent(WaitableIoEventHandle) 1:1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46d7bb9459f7b069ace8bec5ba3da3d8686f42a9;p=thirdparty%2Fntp.git Keep add_full_recv_buffer() and SetEvent(WaitableIoEventHandle) 1:1 bk: 4e8c16a6IAYWfI3PBxKdERPxDruffw --- diff --git a/include/ntp_refclock.h b/include/ntp_refclock.h index 1d7764e8d9..b22b6bee6d 100644 --- a/include/ntp_refclock.h +++ b/include/ntp_refclock.h @@ -120,6 +120,10 @@ struct refclockbug { l_fp times[NCLKBUGTIMES]; /* real times */ }; +#ifdef HAVE_IO_COMPLETION_PORT +extern HANDLE WaitableIoEventHandle; +#endif + /* * Structure interface between the reference clock support * ntp_refclock.c and the driver utility routines diff --git a/ntpd/ntp_refclock.c b/ntpd/ntp_refclock.c index d5a36973c0..f6e527fcdd 100644 --- a/ntpd/ntp_refclock.c +++ b/ntpd/ntp_refclock.c @@ -674,7 +674,9 @@ indicate_refclock_packet( return TRUE; } add_full_recv_buffer(rb); - +#ifdef HAVE_IO_COMPLETION_PORT + SetEvent(WaitableIoEventHandle); +#endif return FALSE; } diff --git a/ntpd/refclock_parse.c b/ntpd/refclock_parse.c index 71ef527256..046a1d62b5 100644 --- a/ntpd/refclock_parse.c +++ b/ntpd/refclock_parse.c @@ -2323,6 +2323,9 @@ local_input( parse->generic->io.recvcount++; packets_received++; add_full_recv_buffer(buf); +#ifdef HAVE_IO_COMPLETION_PORT + SetEvent(WaitableIoEventHandle); +#endif } parse_iodone(&parse->parseio); } diff --git a/ports/winnt/ntpd/ntp_iocompletionport.c b/ports/winnt/ntpd/ntp_iocompletionport.c index eb1c7e4408..aca6337223 100644 --- a/ports/winnt/ntpd/ntp_iocompletionport.c +++ b/ports/winnt/ntpd/ntp_iocompletionport.c @@ -88,8 +88,8 @@ static HANDLE hHeapHandle = NULL; #endif HANDLE WaitableExitEventHandle; -static HANDLE hIoCompletionPort = NULL; -static HANDLE WaitableIoEventHandle = NULL; + HANDLE WaitableIoEventHandle; +static HANDLE hIoCompletionPort; #ifdef NTPNEEDNAMEDHANDLE #define WAITABLEIOEVENTHANDLE "WaitableIoEventHandle" @@ -616,7 +616,6 @@ OnSerialReadComplete( if (!consumed) { packets_received++; handler_pkts++; - SetEvent(WaitableIoEventHandle); } buff = get_free_recv_buffer_alloc(); } @@ -688,7 +687,6 @@ OnRawSerialReadComplete( rio->recvcount++; packets_received++; handler_pkts++; - SetEvent(WaitableIoEventHandle); } rbufp = get_free_recv_buffer_alloc(); }