Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Discard trailing data after a deflated message#8610

Open
swankjesse wants to merge1 commit intomaster
base:master
Choose a base branch
Loading
fromjwilson.1206.deflater

Conversation

swankjesse
Copy link
Collaborator

We can recover from this and it seems like the least worst of our options.

Closes:#8551

We can recover from this and it seems like the least worst of ouroptions.Closes:#8551
if (inflater.bytesRead < totalBytesToRead) {
deflatedBytes.clear()
inflaterSource.close()
this.inflaterSource = null
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

I’m gonna claim it’s really weird if you have a stream-terminating message followed by another message andnoContextTakeover = false. But perhaps I should write a test for this? I’m not exactly sure what reasonable behavior is.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Also - I think the server in the case we’re addressing here is probably buggy. We might be better to follow@Fischiii’s lead and just reject the bogus data.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that was my change to make his PR pass

Choose a reason for hiding this comment

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

@swankjesse@yschimke in case it helps. The server used is a Kestrel (.net version 7) with the WebsocketSharp.Standard2 Framework for the WebwSocket connection. Data transferred is binary form Protobuffer.

@@ -136,6 +139,41 @@ internal class MessageDeflaterInflaterTest {
assertThat(buffer.readUtf8()).isEqualTo("Hello inflation!")
}

/**
* It's possible a self-terminating deflated message will contain trailing data that won't be
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it worth tying this back to the padding bytes in the spec?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@FischiiiFischiiiFischiii left review comments

@yschimkeyschimkeyschimke approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
4 participants
@swankjesse@yschimke@Fischiii@squarejesse

[8]ページ先頭

©2009-2025 Movatter.jp