Copilot commented on code in PR #112:
URL: https://github.com/apache/activemq-nms-amqp/pull/112#discussion_r3344935721
##########
src/NMS.AMQP/Provider/Amqp/AmqpConnection.cs:
##########
@@ -112,12 +112,12 @@ private void OnClosed(IAmqpObject sender, Error error)
internal void OnLocalOpen(Open open)
{
open.ContainerId = Info.ClientId;
- open.ChannelMax = Info.ChannelMax;
- open.MaxFrameSize = (uint) Info.MaxFrameSize;
+ open.ChannelMax = Provider.ChannelMax;
+ open.MaxFrameSize = (uint) Provider.MaxFrameSize;
open.HostName = String.IsNullOrWhiteSpace(this.Provider.VHost) ?
remoteUri.Host : this.Provider.VHost;
Review Comment:
`Provider.MaxFrameSize` is an `int` coming from URI options and can be set
to a negative value; casting a negative `int` to `uint` will produce a huge
frame size and can break protocol negotiation. Guard against non-positive
values before assigning `Open.MaxFrameSize`.
##########
src/NMS.AMQP/Meta/NmsConnectionInfo.cs:
##########
@@ -69,9 +58,6 @@ public NmsConnectionInfo(NmsConnectionId connectionId)
public bool LocalMessageExpiry { get; set; }
public string QueuePrefix { get; set; }
public string TopicPrefix { get; set; }
- public ushort ChannelMax { get; set; } = DEFAULT_CHANNEL_MAX;
- public int MaxFrameSize { get; set; } = DEFAULT_MAX_FRAME_SIZE;
- public int IdleTimeOut { get; set; } = DEFAULT_IDLE_TIMEOUT;
public bool AnonymousRelaySupported { get; set; }
Review Comment:
`NmsConnectionInfo` is a public type; removing `ChannelMax`, `MaxFrameSize`,
and `IdleTimeOut` is a source/binary breaking change for any consumers that
used these properties. Consider reintroducing them as `[Obsolete]` shims (even
if the provider now owns the values) to preserve compatibility for the 2.x line.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact