Skip to content
Snippets Groups Projects
Commit c1b8cdbb authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Actually we only need to not pass rd, SSIZE_MAX doesn't matter

parent cc63360c
No related branches found
No related tags found
No related merge requests found
...@@ -196,8 +196,8 @@ off_t sendfilesocket(int sock, int file, off_t *offset, off_t count) ...@@ -196,8 +196,8 @@ off_t sendfilesocket(int sock, int file, off_t *offset, off_t count)
for (i = wr = 0; i < rd; i += wr) { for (i = wr = 0; i < rd; i += wr) {
wr = sendsocket(sock,buf+i,rd-i); wr = sendsocket(sock,buf+i,rd-i);
if (wr > 0) { if (wr > 0) {
if ((SSIZE_MAX - i) < wr) if ((rd - i) < wr)
wr = SSIZE_MAX - i; wr = rd - i;
continue; continue;
} }
if (wr == SOCKET_ERROR && SOCKET_ERRNO == EWOULDBLOCK) { if (wr == SOCKET_ERROR && SOCKET_ERRNO == EWOULDBLOCK) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment