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

feat: close connection on too large message #59

Merged
merged 2 commits into from
May 12, 2022

Conversation

0xArdi
Copy link
Collaborator

@0xArdi 0xArdi commented May 11, 2022

No description provided.

@0xArdi 0xArdi requested review from DavidMinarsch and marcofavorito and removed request for DavidMinarsch May 11, 2022 10:23
@0xArdi 0xArdi mentioned this pull request May 11, 2022
Comment on lines +1226 to +1228
self.channel = cast(Union[TcpServerChannel, GrpcServerChannel], self.channel)
if self.channel.is_stopped:
raise ConnectionError("The channel is stopped.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Although the previous solution would ultimately have the same outcome, ie the message failing to get sent or received and an exception raised. However, I think this would be much more easy to reason about. Thanks @marcofavorito 😃 .

@marcofavorito marcofavorito self-requested a review May 11, 2022 15:46
Copy link
Collaborator

@marcofavorito marcofavorito left a comment

Choose a reason for hiding this comment

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

LGTM

@DavidMinarsch DavidMinarsch merged commit 4fd98c8 into main May 12, 2022
@DavidMinarsch DavidMinarsch deleted the feat/close_connection branch May 12, 2022 01:50
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.

3 participants