From: Dave Hart Date: Sun, 19 Feb 2012 16:30:28 +0000 (+0000) Subject: fix user-mode PPS end of line timestamp, and use wait I/O X-Git-Tag: NTP_4_2_7P258~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7773031a324ead03236e0fda43acc77265fb34c;p=thirdparty%2Fntp.git fix user-mode PPS end of line timestamp, and use wait I/O completion timestamp not read completion. bk: 4f4123a4s9ifns6WnPiMvbWskhefqQ --- diff --git a/ports/winnt/ntpd/ntp_iocompletionport.c b/ports/winnt/ntpd/ntp_iocompletionport.c index 6a21105ba..cbec92e36 100644 --- a/ports/winnt/ntpd/ntp_iocompletionport.c +++ b/ports/winnt/ntpd/ntp_iocompletionport.c @@ -625,6 +625,8 @@ OnSerialWaitComplete( lpo->flTsFlag = 1; QueueSerialRead(rio, buff, lpo); } else if (EV_RXCHAR & lpo->com_events) { /* raw discipline */ + lpo->FlagTime = lpo->RecvTime; + lpo->flTsFlag = 1; QueueRawSerialRead(rio, buff, lpo); } else { /* idle... */ QueueSerialWait(rio, buff, lpo); @@ -656,7 +658,7 @@ QueueSerialRead( { BOOL rc; - lpo->onIoDone = OnSerialReadComplete; + lpo->onIoDone = &OnSerialReadComplete; lpo->recv_buf = buff; lpo->flRawMem = 0; lpo->rio = rio; @@ -763,6 +765,7 @@ OnSerialReadWorker(void * ctx) obuf->receiver = &process_refclock_packet; obuf->dstadr = NULL; obuf->recv_peer = rio->srcclock; + set_serial_recv_time(obuf, lpo); /* * Copy data to new buffer, convert CR to LF on @@ -875,9 +878,9 @@ OnRawSerialReadComplete( if (lpo->byteCount > 0) { buff->recv_length = (int)lpo->byteCount; buff->dstadr = NULL; - buff->recv_time = lpo->RecvTime; buff->receiver = process_refclock_packet; buff->recv_peer = rio->srcclock; + set_serial_recv_time(buff, lpo); add_full_recv_buffer(buff); SetEvent(WaitableIoEventHandle); buff = get_free_recv_buffer_alloc();