From 507062d51b3e018fdfac838e7982ffe62ff423c5 Mon Sep 17 00:00:00 2001
From: Anton Kling <anton@kling.gg>
Date: Sun, 28 Apr 2024 21:39:53 +0200
Subject: Kernel: Use ringbuffer for handling incoming socket data

---
 kernel/queue.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'kernel/queue.c')

diff --git a/kernel/queue.c b/kernel/queue.c
index 0bef21b..43b2400 100644
--- a/kernel/queue.c
+++ b/kernel/queue.c
@@ -65,8 +65,7 @@ int queue_should_block(struct event_queue *q, int *is_empty) {
     } else if (EVENT_TYPE_TCP_SOCKET == ev->type) {
       struct TcpConnection *con = tcp_get_connection(ev->internal_id, q->p);
       assert(con);
-      assert(con->data_file);
-      if (con->data_file->has_data) {
+      if (!ringbuffer_isempty(&con->buffer)) {
         return 0;
       }
     }
-- 
cgit v1.2.3