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

Only log when TransportLimits actually changed #1183

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rnestler
Copy link
Contributor

Based on #1181

@oroulet
Copy link
Member

oroulet commented Jan 22, 2023

need rebase too

@rnestler rnestler marked this pull request as ready for review December 26, 2023 15:17
@rnestler
Copy link
Contributor Author

@oroulet Rebased.

Comment on lines +56 to +64
max_recv_buffer = ack.ReceiveBufferSize if role == "client" else ack.SendBufferSize
max_send_buffer = ack.SendBufferSize if role == "client" else ack.ReceiveBufferSize

new_limits = TransportLimits(
max_chunk_count=ack.MaxChunkCount,
max_recv_buffer=max_recv_buffer,
max_send_buffer=max_send_buffer,
max_message_size=ack.MaxMessageSize,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm now not sure if it makes sense to create the new_limits here or if we should keep this in the other methods, since it differs between client and server.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry That MR disapeard into the backlog.. but yes inline would be better I think

@@ -51,17 +52,30 @@ def is_chunk_count_within_limit(self, sz: int) -> bool:
_logger.error("Number of message chunks: %s is > configured max chunk count: %s", sz, self.max_chunk_count)
return within_limit

def _set_new_limits_from_ack(self, ack: ua.Acknowledge, role: Literal["client", "server"]) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

if you really need that Role, it should be an enum.
But in that case I would jsut create two methods, one for server and one for client. That is simpler

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.

2 participants