Skip to content

Commit 46766aa

Browse files
author
Vlad Ionescu
committed
fixing access to ConnectionFactory.DefaultClientProperties; fixing access to ConnectionBase.ClientProperties
1 parent 7118742 commit 46766aa

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ public class ConnectionFactory
126126
/// seconds, with zero meaning none (value: 0)</summary>
127127
public const ushort DefaultHeartbeat = 0; // PLEASE KEEP THIS MATCHING THE DOC ABOVE
128128

129-
/// <summary>Default value for extra client properties to be sent to
130-
/// the server (value: empty Hashtable)
131-
public static readonly IDictionary DefaultClientProperties = new Hashtable(); // PLEASE KEEP THIS MATCHING THE DOC ABOVE
132-
133129
/// <summary>Username to use when authenticating to the server</summary>
134130
public string UserName = DefaultUser;
135131

@@ -165,6 +161,16 @@ public class ConnectionFactory
165161
///<summary>The AMQP protocol to be used</summary>
166162
public IProtocol Protocol = Protocols.FromEnvironment();
167163

164+
/// <summary>Default value for extra client properties to be sent to
165+
/// the server (value: empty Hashtable)</summary>
166+
public static IDictionary DefaultClientProperties
167+
{
168+
get
169+
{
170+
return new Hashtable(); // PLEASE KEEP THIS MATCHING THE DOC ABOVE
171+
}
172+
}
173+
168174
public AmqpTcpEndpoint Endpoint
169175
{
170176
get

projects/client/RabbitMQ.Client/src/client/api/IConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public interface IConnection: IDisposable
116116
///(0 for disabled), in seconds.</summary>
117117
ushort Heartbeat { get; }
118118

119-
///<summary>The client properties that has been sent to the
119+
///<summary>A copy of the client properties that has been sent to the
120120
///server.</summary>
121121
IDictionary ClientProperties { get; }
122122

projects/client/RabbitMQ.Client/src/client/impl/ConnectionBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public IDictionary ClientProperties
255255
{
256256
get
257257
{
258-
return m_clientProperties;
258+
return new Hashtable(m_clientProperties);
259259
}
260260
set
261261
{
@@ -973,12 +973,12 @@ public void Open(bool insist)
973973
serverVersion.Minor);
974974
}
975975

976-
ClientProperties = BuildClientPropertiesTable(m_factory.ClientProperties);
976+
m_clientProperties = BuildClientPropertiesTable(m_factory.ClientProperties);
977977

978978
// FIXME: check that PLAIN is supported.
979979
// FIXME: parse out locales properly!
980980
ConnectionTuneDetails connectionTune =
981-
m_model0.ConnectionStartOk(ClientProperties,
981+
m_model0.ConnectionStartOk(m_clientProperties,
982982
"PLAIN",
983983
Encoding.UTF8.GetBytes("\0" + m_factory.UserName +
984984
"\0" + m_factory.Password),

0 commit comments

Comments
 (0)