| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using CoreWCF.Runtime; |
| | | 6 | | |
| | | 7 | | namespace CoreWCF.Channels |
| | | 8 | | { |
| | | 9 | | internal class BufferManagerOutputStream : BufferedOutputStream |
| | | 10 | | { |
| | | 11 | | private readonly string _quotaExceededString; |
| | | 12 | | |
| | 526 | 13 | | public BufferManagerOutputStream(string quotaExceededString) : base() |
| | | 14 | | { |
| | 526 | 15 | | _quotaExceededString = quotaExceededString; |
| | 526 | 16 | | } |
| | | 17 | | |
| | 1 | 18 | | public BufferManagerOutputStream(string quotaExceededString, int maxSize) : base(maxSize) |
| | | 19 | | { |
| | 1 | 20 | | _quotaExceededString = quotaExceededString; |
| | 1 | 21 | | } |
| | | 22 | | |
| | | 23 | | public BufferManagerOutputStream(string quotaExceededString, int initialSize, int maxSize, BufferManager bufferM |
| | 3153 | 24 | | : base(initialSize, maxSize, BufferManager.GetInternalBufferManager(bufferManager)) |
| | | 25 | | { |
| | 3153 | 26 | | _quotaExceededString = quotaExceededString; |
| | 3153 | 27 | | } |
| | | 28 | | |
| | | 29 | | public void Init(int initialSize, int maxSizeQuota, BufferManager bufferManager) |
| | | 30 | | { |
| | 0 | 31 | | Init(initialSize, maxSizeQuota, maxSizeQuota, bufferManager); |
| | 0 | 32 | | } |
| | | 33 | | |
| | | 34 | | public void Init(int initialSize, int maxSizeQuota, int effectiveMaxSize, BufferManager bufferManager) |
| | | 35 | | { |
| | 774 | 36 | | Reinitialize(initialSize, maxSizeQuota, effectiveMaxSize, BufferManager.GetInternalBufferManager(bufferManag |
| | 774 | 37 | | } |
| | | 38 | | |
| | | 39 | | protected override Exception CreateQuotaExceededException(int maxSizeQuota) |
| | | 40 | | { |
| | 0 | 41 | | string excMsg = SR.Format(_quotaExceededString, maxSizeQuota); |
| | | 42 | | //if (TD.MaxSentMessageSizeExceededIsEnabled()) |
| | | 43 | | //{ |
| | | 44 | | // TD.MaxSentMessageSizeExceeded(excMsg); |
| | | 45 | | //} |
| | 0 | 46 | | return new QuotaExceededException(excMsg); |
| | | 47 | | } |
| | | 48 | | } |
| | | 49 | | } |