Skip to content

Commit 4f570c6

Browse files
committed
Fix bug I introduced
1 parent e77c8f5 commit 4f570c6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public sealed class ConnectionFactory : ConnectionFactoryBase, IAsyncConnectionF
189189

190190
// just here to hold the value that was set through the setter
191191
private Uri _uri;
192-
private ArrayPool<byte> _memoryPool;
192+
private ArrayPool<byte> _memoryPool = ArrayPool<byte>.Shared;
193193

194194
/// <summary>
195195
/// The memory pool used for allocating buffers. Default is <see cref="MemoryPool{T}.Shared"/>.

projects/RabbitMQ.Client/client/impl/Connection.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ public Connection(IConnectionFactory factory, bool insist, IFrameHandler frameHa
132132
string clientProvidedName = null)
133133
: this(factory, insist, frameHandler, clientProvidedName)
134134
{
135+
if (memoryPool == null)
136+
{
137+
throw new ArgumentNullException(nameof(memoryPool));
138+
}
135139
_memoryPool = memoryPool;
136140
}
137141

projects/Unit/APIApproval.Approve.verified.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ namespace RabbitMQ.Client
7878
public static readonly System.TimeSpan DefaultConnectionTimeout;
7979
public static readonly System.TimeSpan DefaultHeartbeat;
8080
public ConnectionFactory() { }
81-
public ConnectionFactory(System.Buffers.ArrayPool<byte> memoryPool) { }
8281
public System.Security.Authentication.SslProtocols AmqpUriSslProtocols { get; set; }
8382
public System.Collections.Generic.IList<RabbitMQ.Client.IAuthMechanismFactory> AuthMechanisms { get; set; }
8483
public bool AutomaticRecoveryEnabled { get; set; }
@@ -91,7 +90,7 @@ namespace RabbitMQ.Client
9190
public System.Func<System.Collections.Generic.IEnumerable<RabbitMQ.Client.AmqpTcpEndpoint>, RabbitMQ.Client.IEndpointResolver> EndpointResolverFactory { get; set; }
9291
public System.TimeSpan HandshakeContinuationTimeout { get; set; }
9392
public string HostName { get; set; }
94-
public System.Buffers.ArrayPool<byte> MemoryPool { get; }
93+
public System.Buffers.ArrayPool<byte> MemoryPool { get; set; }
9594
public System.TimeSpan NetworkRecoveryInterval { get; set; }
9695
public string Password { get; set; }
9796
public int Port { get; set; }

0 commit comments

Comments
 (0)