From e5dc14e20c912c83631a6056af14eea8cc847155 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 30 Jan 2012 22:52:56 +0900 Subject: [PATCH] Use CLOCK_MONOTONIC_RAW --- lib/spdylay_session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spdylay_session.c b/lib/spdylay_session.c index e7cc9842..71133ab6 100644 --- a/lib/spdylay_session.c +++ b/lib/spdylay_session.c @@ -526,7 +526,7 @@ static int spdylay_session_after_frame_sent(spdylay_session *session) reply PING is received. */ session->last_ping_unique_id = frame->ping.unique_id; /* TODO If clock_gettime() fails, what should we do? */ - clock_gettime(CLOCK_MONOTONIC, &session->last_ping_time); + clock_gettime(CLOCK_MONOTONIC_RAW, &session->last_ping_time); break; case SPDYLAY_GOAWAY: session->goaway_flags |= SPDYLAY_GOAWAY_SEND; @@ -857,7 +857,7 @@ int spdylay_session_on_ping_received(spdylay_session *session, if(session->last_ping_unique_id == frame->ping.unique_id) { /* This is ping reply from peer */ struct timespec rtt; - clock_gettime(CLOCK_MONOTONIC, &rtt); + clock_gettime(CLOCK_MONOTONIC_RAW, &rtt); rtt.tv_nsec -= session->last_ping_time.tv_nsec; if(rtt.tv_nsec < 0) { rtt.tv_nsec += 1000000000;