Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

fix stream deadlines #107

Merged
merged 3 commits into from
Aug 25, 2021
Merged

fix stream deadlines #107

merged 3 commits into from
Aug 25, 2021

Conversation

marten-seemann
Copy link
Contributor

A malicious peer could also block writes to a stream (for example by withholding flow control credit). We therefore need to set both read and write deadlines.
This PR also adds a deadline to streams opened by the client, and adds a missing stream reset in one of the error cases.

"github.com/libp2p/go-msgio/protoio"
ma "github.com/multiformats/go-multiaddr"
)

var streamReadTimeout = 60 * time.Second
var streamTimeout = 60 * time.Second
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can probably reduce this to 5-10 seconds as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we can punt that.

@Stebalien Stebalien merged commit 3723bd5 into master Aug 25, 2021
@Stebalien Stebalien deleted the fix-deadlines branch August 25, 2021 15:43
@aschmahmann aschmahmann mentioned this pull request Dec 1, 2021
80 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants