Skip to content

Commit

Permalink
Merge pull request #5224 from rgerhards/tcpflood-send-fix
Browse files Browse the repository at this point in the history
tcpflood bugfix: plain tcp send error not properly reported
  • Loading branch information
rgerhards committed Sep 13, 2023
2 parents db6ef15 + c8a2969 commit fa99273
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/tcpflood.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,18 +665,18 @@ genMsg(char *buf, size_t maxBuf, size_t *pLenBuf, struct instdata *inst)


static int
sendPlainTCP(int socknum, char *buf, size_t lenBuf, int *ret_errno)
sendPlainTCP(const int socknum, const char *const buf, const size_t lenBuf, int *const ret_errno)
{
size_t lenSent;
int r, err;
int r;

lenSent = 0;
while(lenSent != lenBuf) {
r = send(sockArray[socknum], buf + lenSent, lenBuf - lenSent, 0);
if(r > 0) {
lenSent += r;
} else {
err = errno;
*ret_errno = errno;
goto finalize_it;
}
}
Expand Down

0 comments on commit fa99273

Please sign in to comment.