HomeFreeBSD

Make `server_cat(..)` handle short receives

Description

Make server_cat(..) handle short receives

In short, the prior code was far too simplistic when it came to calling recv(2)
and failed intermittently (or in the case of Jenkins, deterministically).

Handle short recv(2)s by checking the return code and incrementing the window
into the buffer by the number of received bytes. If the number of received
bytes <= 0, then bail out of the loop, and test the total number of received
bytes vs the expected number of bytes sent for equality, and base whether or
not the test passes/fails on that fact.

Remove the expected failure, now that the hdtr testcases deterministically pass
on my host after this change [1].

PR: 234809 [1], 235200
Reviewed by: asomers
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19188

Details

Provenance
ngieAuthored on
Reviewer
asomers
Differential Revision
D19188: Make `server_cat(..)` handle short receives
Parents
rS344309: Place an upper bound on the number of iterations for REP.
Branches
Unknown
Tags
Unknown