Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't write from the read function #50

Merged
merged 2 commits into from Feb 4, 2020
Merged

fix: don't write from the read function #50

merged 2 commits into from Feb 4, 2020

Conversation

Stebalien
Copy link
Member

This was causing a double-write.

fixes libp2p/go-libp2p-pnet#31
probably fixes ipfs/kubo#6802
fixes ipfs/kubo#6197

This was causing a double-write.

fixes libp2p/go-libp2p-pnet#31
probably fixes ipfs/kubo#6802
fixes ipfs/kubo#6197
@Stebalien Stebalien requested a review from vyzo February 4, 2020 01:22
@Stebalien
Copy link
Member Author

cc @bonedaddy

@Stebalien
Copy link
Member Author

After we merge this, we can revert libp2p/go-ws-transport#65.

Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

LGTM, modulo a question.

Comment on lines -403 to -406
err := delimWriteBuffered(rw, []byte("messages over 64k are not allowed"))
if err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

are we reporting this error anywhere now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Back to the user. We don't bother sending it to the other side. If someone establishes a connection and sends us garbage, we'll reset the connection and walk away.

@Stebalien Stebalien merged commit bd94c78 into master Feb 4, 2020
@Stebalien Stebalien deleted the fix/read-only branch February 4, 2020 17:55
Stebalien added a commit to libp2p/go-ws-transport that referenced this pull request Feb 4, 2020
marten-seemann pushed a commit to libp2p/go-libp2p that referenced this pull request Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic in ipfs node Data Race Issues Daemon panic: concurrent write to websocket connection
3 participants