From 3fb0de372cf7b6530c38e652accd3d7c48ef3d39 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 27 Feb 2024 12:43:44 +1300 Subject: [PATCH] Actually use ConnectionConfiguration.DefaultMemoryStreamFactory (#552) (#560) * actually use ConnectionConfiguration.DefaultMemoryStreamFactory Signed-off-by: Donovan Jimenez * Add ConnectionConfiguration.DefaultMemoryStreamFactory changelog Signed-off-by: Donovan Jimenez --------- Signed-off-by: Donovan Jimenez (cherry picked from commit 80854014b7376f6882ebb3010c0309a0f9774808) Co-authored-by: Donovan Jimenez --- CHANGELOG.md | 3 ++- src/OpenSearch.Net/Configuration/ConnectionConfiguration.cs | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff9cb26621..17e4ae4cba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `.Strict(...)`, `.Verbatim(...)`, `.Name(...)` methods on `QueryContainer` to help modify contained query attributes ([#509](https://github.com/opensearch-project/opensearch-net/pull/509)) ### Fixed +- Fixed `HttpConnection.ConvertHttpMethod` to support `Patch` method ([#489](https://github.com/opensearch-project/opensearch-net/pull/489)) - Fixed `IEnumerable` property mapping. ([#503](https://github.com/opensearch-project/opensearch-net/pull/503)) -- Fix `HttpConnection.ConvertHttpMethod` to support `Patch` method ([#489](https://github.com/opensearch-project/opensearch-net/pull/489)) +- Fixed `ConnectionConfiguration.DefaultMemoryStreamFactory` actually used as default. ([#552](https://github.com/opensearch-project/opensearch-net/pull/552)) ### Dependencies - Bumps `NSwag.Core.Yaml` from 13.19.0 to 14.0.3 diff --git a/src/OpenSearch.Net/Configuration/ConnectionConfiguration.cs b/src/OpenSearch.Net/Configuration/ConnectionConfiguration.cs index d41e860005..1b67cd4cb7 100644 --- a/src/OpenSearch.Net/Configuration/ConnectionConfiguration.cs +++ b/src/OpenSearch.Net/Configuration/ConnectionConfiguration.cs @@ -200,9 +200,8 @@ public abstract class ConnectionConfiguration : IConnectionConfigurationValue private bool _sniffOnStartup; private bool _throwExceptions; private bool _transferEncodingChunked; - private IMemoryStreamFactory _memoryStreamFactory = RecyclableMemoryStreamFactory.Default; + private IMemoryStreamFactory _memoryStreamFactory = DefaultMemoryStreamFactory; private bool _enableTcpStats; - //public static IMemoryStreamFactory Default { get; } = RecyclableMemoryStreamFactory.Default; public static IMemoryStreamFactory DefaultMemoryStreamFactory { get; } = OpenSearch.Net.MemoryStreamFactory.Default; private bool _enableThreadPoolStats; @@ -627,7 +626,7 @@ public T SkipDeserializationForStatusCodes(params int[] statusCodes) => public T TransferEncodingChunked(bool transferEncodingChunked = true) => Assign(transferEncodingChunked, (a, v) => a._transferEncodingChunked = v); /// - /// The memory stream factory to use, defaults to + /// The memory stream factory to use, defaults to /// public T MemoryStreamFactory(IMemoryStreamFactory memoryStreamFactory) => Assign(memoryStreamFactory, (a, v) => a._memoryStreamFactory = v);