Skip to content

Commit b1b43aa

Browse files
committed
merge v1_5 into default
2 parents 7ee5e27 + 17d21d1 commit b1b43aa

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

src/client/api/ConnectionParameters.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public class ConnectionParameters : ICloneable
7171
/// <summary>Default virtual host (value: "/")</summary>
7272
public const string DefaultVHost = "/"; // PLEASE KEEP THIS MATCHING THE DOC ABOVE
7373

74-
/// <summary> Default value for the desired maximum number of
75-
/// channels, with zero meaning unlimited (value: 0)</summary>
74+
/// <summary> Default value for the desired maximum channel
75+
/// number, with zero meaning unlimited (value: 0)</summary>
7676
public const ushort DefaultChannelMax = 0; // PLEASE KEEP THIS MATCHING THE DOC ABOVE
7777

7878
/// <summary>Default value for the desired maximum frame size,
@@ -115,7 +115,7 @@ public string VirtualHost
115115
set { m_virtualHost = value; }
116116
}
117117

118-
/// <summary>Channel-max parameter to ask for (number of channels)</summary>
118+
/// <summary>Maximum channel number to ask for</summary>
119119
public ushort RequestedChannelMax
120120
{
121121
get { return m_requestedChannelMax; }

src/client/api/IConnection.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ public interface IConnection: IDisposable
107107
///of this connection.</summary>
108108
ConnectionParameters Parameters { get; }
109109

110-
///<summary>The maximum number of channels this connection
111-
///supports (0 if unlimited).</summary>
110+
///<summary>The maximum channel number this connection
111+
///supports (0 if unlimited). Usable channel numbers
112+
///range from 1 to this number, inclusive.</summary>
112113
ushort ChannelMax { get; }
113114

114115
///<summary>The maximum frame size this connection supports (0

src/client/impl/SessionManager.cs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,7 @@ public ushort ChannelMax
8484
}
8585
set
8686
{
87-
if ((value < 2) && (value != 0))
88-
{
89-
// We currently interpret channel max as
90-
// *including* channel zero. We also think it
91-
// doesn't make sense to forbid opening of any
92-
// real usable channels, so by our ch0-including
93-
// assumption, the minimum *useful* value for
94-
// channel max is 2.
95-
//
96-
// This code is here to work around OpenAMQ
97-
// 1.2c4's channel max setting of 1.
98-
//
99-
// FIXME: warning? or is there something more
100-
// sensible we can do here?
101-
m_channelMax = 2;
102-
}
103-
else
104-
{
105-
m_channelMax = value;
106-
}
87+
m_channelMax = value;
10788
}
10889
}
10990

@@ -192,7 +173,7 @@ public ISession Swap(int channelNumber, ISession replacement) {
192173
public int Allocate()
193174
{
194175
ushort maxChannels = (m_channelMax == 0) ? ushort.MaxValue : m_channelMax;
195-
for (int candidate = 1; candidate < maxChannels; candidate++)
176+
for (int candidate = 1; candidate <= maxChannels; candidate++)
196177
{
197178
if (!m_sessionMap.ContainsKey(candidate))
198179
{

0 commit comments

Comments
 (0)