Skip to content

Commit

Permalink
tcpflood: fix today's programming error
Browse files Browse the repository at this point in the history
In commit 5050249 tcpflood was "fixed" to work properly when senden
data to a TCP stream socket. Unfortunately, there was an undetected
copy&past problem, which this commit corrects.

The issue did unfortunatley not surfcase with the previous commit as
the situation where this can happen occurs infrequently and randomly
(has to do with timing on the system in question). So the original PR
went fine, but later PRs brought the issue up.

This is not a real regression, as the original fix was for the same
symptom, but with different cause. Now everything should indeed be
fixed.

NOTE: same day correction on a testbench tool
  • Loading branch information
rgerhards committed Jul 28, 2023
1 parent 9538f8a commit 4455f63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/tcpflood.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ sendPlainTCP(int socknum, char *buf, size_t lenBuf, int *ret_errno)

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

0 comments on commit 4455f63

Please sign in to comment.