diff options
| author | Simon Rettberg | 2025-10-29 18:05:00 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2025-12-09 15:33:20 +0100 |
| commit | 062df52ab9f3464ce79ca91d54fa3d2ad209a31b (patch) | |
| tree | 2bb2c53a0e29a9691a77199fa631a007e4d96fa2 /src/shared/sockhelper.c | |
| parent | [SERVER] iscsi: Honor global _shutdown (diff) | |
| download | dnbd3-062df52ab9f3464ce79ca91d54fa3d2ad209a31b.tar.gz dnbd3-062df52ab9f3464ce79ca91d54fa3d2ad209a31b.tar.xz dnbd3-062df52ab9f3464ce79ca91d54fa3d2ad209a31b.zip | |
[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.
Diffstat (limited to 'src/shared/sockhelper.c')
| -rw-r--r-- | src/shared/sockhelper.c | 2 |
1 files changed, 1 insertions, 1 deletions
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}; |
