From 062df52ab9f3464ce79ca91d54fa3d2ad209a31b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 29 Oct 2025 18:05:00 +0100 Subject: [SERVER] iscsi: Refactor receive function and PDU handling - Fold header/data handling into one function This uncovered a few redundant checks and makes it easier to reason about control flow - Make all iscsi_pdu stack-allocated This greatly reduces the number of malloc and free calls during normal operation, lowers the risk of memory management bugs, and potentially increases performance in high concurrency scenarios. --- src/shared/sockhelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared/sockhelper.c') diff --git a/src/shared/sockhelper.c b/src/shared/sockhelper.c index 08d73fc..b3f479a 100644 --- a/src/shared/sockhelper.c +++ b/src/shared/sockhelper.c @@ -440,7 +440,7 @@ ssize_t sock_recv(const int sock, void *buffer, const size_t len) return (ssize_t)done; } -bool sock_sendPadding(const int fd, uint32_t bytes) +bool sock_sendPadding(const int fd, size_t bytes) { static char nullbytes[512] = {0}; -- cgit v1.2.3-55-g7522