From 2cfc09ead41b6c8ced7d896809d3f53f0c90a015 Mon Sep 17 00:00:00 2001 From: Xie Han <63350856@qq.com> Date: Wed, 17 Sep 2025 22:19:31 +0800 Subject: [PATCH] Add CommMessageIn::renew(). --- src/kernel_win/Communicator.cc | 7 +++++++ src/kernel_win/Communicator.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/kernel_win/Communicator.cc b/src/kernel_win/Communicator.cc index 6fa895e5..bfb5c975 100644 --- a/src/kernel_win/Communicator.cc +++ b/src/kernel_win/Communicator.cc @@ -180,6 +180,13 @@ static int __ssl_connect(SSL_CTX *ssl_ctx, CommConnEntry *entry) return -1; } +void CommMessageIn::renew() +{ + CommSession *session = this->entry->session; + session->timeout = -1; + session->begin_time = -1; +} + int CommTarget::init(const struct sockaddr *addr, socklen_t addrlen, int connect_timeout, int response_timeout) { diff --git a/src/kernel_win/Communicator.h b/src/kernel_win/Communicator.h index e3cc1a88..b1287cc6 100644 --- a/src/kernel_win/Communicator.h +++ b/src/kernel_win/Communicator.h @@ -118,6 +118,9 @@ protected: /* Send small packet while receiving. Call only in append(). */ virtual int feedback(const void *buf, size_t size); + /* In append(), reset the begin time of receiving to current time. */ + virtual void renew(); + private: struct CommConnEntry *entry; @@ -164,6 +167,7 @@ private: public: CommSession() { this->passive = 0; } virtual ~CommSession(); + friend class CommMessageIn; friend class Communicator; };