From 50b44b4ab3ea8dcdf329c6796e40170bc2051fa8 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 15 Apr 2025 11:50:44 -0400 Subject: [PATCH] MT#55283 convert streambuf to int64_t Change-Id: I856072b6e82c854b676dd43ae2c7120d68caad2c --- daemon/recording.c | 4 ++-- lib/streambuf.c | 8 ++++---- lib/streambuf.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daemon/recording.c b/daemon/recording.c index 107e6e2d2..0e6d6a956 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -562,8 +562,8 @@ static void rec_pcap_meta_finish_file(call_t *call) { // Print start timestamp and end timestamp // YYYY-MM-DDThh:mm:ss - time_t start = timeval_from_us(call->created).tv_sec; - time_t end = timeval_from_us(rtpe_now).tv_sec; + time_t start = call->created / 1000000; + time_t end = rtpe_now / 1000000; char timebuffer[20]; struct tm timeinfo; int64_t terminate; diff --git a/lib/streambuf.c b/lib/streambuf.c index c84261ac4..dd2988a0e 100644 --- a/lib/streambuf.c +++ b/lib/streambuf.c @@ -38,7 +38,7 @@ struct streambuf *streambuf_new_ptr(struct poller *p, void *fd_ptr, const struct b->buf = g_string_new(""); b->fd_ptr = fd_ptr; b->poller = p; - b->active = timeval_from_us(rtpe_now).tv_sec; + b->active_us = rtpe_now; b->funcs = funcs; return b; @@ -79,7 +79,7 @@ int streambuf_writeable(struct streambuf *b) { if (ret > 0) { g_string_erase(b->buf, 0, ret); - b->active = timeval_from_us(rtpe_now).tv_sec; + b->active_us = rtpe_now; } if (ret != out) { @@ -118,7 +118,7 @@ int streambuf_readable(struct streambuf *b) { } g_string_append_len(b->buf, buf, ret); - b->active = timeval_from_us(rtpe_now).tv_sec; + b->active_us = rtpe_now; } mutex_unlock(&b->lock); @@ -233,7 +233,7 @@ void streambuf_write(struct streambuf *b, const char *s, unsigned int len) { s += ret; len -= ret; - b->active = timeval_from_us(rtpe_now).tv_sec; + b->active_us = rtpe_now; } if (b->buf->len > 5242880) diff --git a/lib/streambuf.h b/lib/streambuf.h index c1f9612d0..c5a38756d 100644 --- a/lib/streambuf.h +++ b/lib/streambuf.h @@ -27,7 +27,7 @@ struct streambuf { GString *buf; void *fd_ptr; struct poller *poller; - time_t active; + int64_t active_us; int eof; const struct streambuf_funcs *funcs;