summaryrefslogtreecommitdiff
path: root/src/server.c
diff options
context:
space:
mode:
authorzhenwei pi <pizhenwei@bytedance.com>2022-07-27 10:39:49 +0800
committerzhenwei pi <pizhenwei@bytedance.com>2022-08-22 15:11:06 +0800
commit709b55b09dee2d22ae306d00b2c9ead1d382c044 (patch)
treeb84bb4989b008a25ee6353e90f472450f897431e /src/server.c
parent8234a5123d8727a0b72c7b1a2524edd113ffe016 (diff)
downloadredis-709b55b09dee2d22ae306d00b2c9ead1d382c044.tar.gz
Introduce pending data for connection type
Introduce .has_pending_data and .process_pending_data for connection type, and hide tlsHasPendingData() and tlsProcessPendingData(). Also set .has_pending_data and .process_pending_data as NULL explicitly in socket.c. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server.c b/src/server.c
index fe8d9bb81..5fd4c7f84 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1535,7 +1535,7 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
if (ProcessingEventsWhileBlocked) {
uint64_t processed = 0;
processed += handleClientsWithPendingReadsUsingThreads();
- processed += tlsProcessPendingData();
+ processed += connTypeProcessPendingData();
if (server.aof_state == AOF_ON || server.aof_state == AOF_WAIT_REWRITE)
flushAppendOnlyFile(0);
processed += handleClientsWithPendingWrites();
@@ -1550,11 +1550,11 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
/* We should handle pending reads clients ASAP after event loop. */
handleClientsWithPendingReadsUsingThreads();
- /* Handle TLS pending data. (must be done before flushAppendOnlyFile) */
- tlsProcessPendingData();
+ /* Handle pending data(typical TLS). (must be done before flushAppendOnlyFile) */
+ connTypeProcessPendingData();
- /* If tls still has pending unread data don't sleep at all. */
- aeSetDontWait(server.el, tlsHasPendingData());
+ /* If any connection type(typical TLS) still has pending unread data don't sleep at all. */
+ aeSetDontWait(server.el, connTypeHasPendingData());
/* Call the Redis Cluster before sleep function. Note that this function
* may change the state of Redis Cluster (from ok to fail or vice versa),