lukechampine / us

An alternative interface to Sia
MIT License
55 stars 4 forks source link

renterhost: Prevent data race during overlapping read/write #155

Closed lukechampine closed 3 years ago

lukechampine commented 3 years ago

In RPCRead, the host needs to continuously attempt to Read from the renter while it simultaneously Writes responses to it. This causes a data race on the err and closed fields of Session. Fixed by adding a mutex that guards these fields.

Fixes #154

lukechampine commented 3 years ago

Goober, test and merge