Move content offered log after socket close wait (#1530)

To be clear that the socket also got closed before this.
Also explain that on socket close, the actual socket still waits
for an ACK.
This commit is contained in:
Kim De Mey 2023-04-04 17:36:57 +02:00 committed by GitHub
parent 5e865edec0
commit fdad9cfd00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -834,9 +834,9 @@ proc offer(p: PortalProtocol, o: OfferRequest):
socket.close()
return err("Error writing requested data")
await socket.closeWait()
debug "Content successfully offered"
await socket.closeWait()
return ok(m.contentKeys)
else:
warn "Offer failed due to accept request failure ",

View File

@ -257,7 +257,9 @@ proc readContentOffer(
else:
# This means FIN didn't arrive yet, perhaps it got dropped but it might also
# be still in flight. Closing the socket (= sending FIN) ourselves.
# Not waiting here for its ACK however, so no `closeWait`
# Not waiting here for its ACK however, so no `closeWait`. Underneath the
# socket will still wait for the FIN-ACK (or timeout) before it destroys the
# socket.
socket.close()
# TODO: This could currently create a backlog of content items to be validated