diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-02-06 11:17:34 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-02-06 11:17:34 +0100 |
commit | 18ab8207bd14def950fd399c60d9ee54fab75d3b (patch) | |
tree | a82af333127184acc6be6e0969919cb20be5e8b3 /csharp/src/Ice/BatchRequestQueue.cs | |
parent | Fixed ICE-7548 - getAdminProxy no longer returns 0 if synchronization is in p... (diff) | |
download | ice-18ab8207bd14def950fd399c60d9ee54fab75d3b.tar.bz2 ice-18ab8207bd14def950fd399c60d9ee54fab75d3b.tar.xz ice-18ab8207bd14def950fd399c60d9ee54fab75d3b.zip |
Fixed ICE-7169 and ICE-7375 - add option to specify if batch requests flushed with the communicator/connection should be compressed
Diffstat (limited to 'csharp/src/Ice/BatchRequestQueue.cs')
-rw-r--r-- | csharp/src/Ice/BatchRequestQueue.cs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/csharp/src/Ice/BatchRequestQueue.cs b/csharp/src/Ice/BatchRequestQueue.cs index 5507e879933..a2d3ee13857 100644 --- a/csharp/src/Ice/BatchRequestQueue.cs +++ b/csharp/src/Ice/BatchRequestQueue.cs @@ -27,7 +27,7 @@ namespace IceInternal public void enqueue() { - _queue.enqueueBatchRequest(); + _queue.enqueueBatchRequest(_proxy); } public Ice.ObjectPrx getProxy() @@ -118,6 +118,11 @@ namespace IceInternal } else { + bool compress; + if(((Ice.ObjectPrxHelperBase)proxy).iceReference().getCompressOverride(out compress)) + { + _batchCompress |= compress; + } _batchMarker = _batchStream.size(); ++_batchRequestNum; } @@ -150,12 +155,13 @@ namespace IceInternal } public int - swap(Ice.OutputStream os) + swap(Ice.OutputStream os, out bool compress) { lock(this) { if(_batchRequestNum == 0) { + compress = false; return 0; } @@ -172,12 +178,14 @@ namespace IceInternal } int requestNum = _batchRequestNum; + compress = _batchCompress; _batchStream.swap(os); // // Reset the batch. // _batchRequestNum = 0; + _batchCompress = false; _batchStream.writeBlob(Protocol.requestBatchHdr); _batchMarker = _batchStream.size(); if(lastRequest != null) @@ -221,9 +229,14 @@ namespace IceInternal } } - internal void enqueueBatchRequest() + internal void enqueueBatchRequest(Ice.ObjectPrx proxy) { Debug.Assert(_batchMarker < _batchStream.size()); + bool compress; + if(((Ice.ObjectPrxHelperBase)proxy).iceReference().getCompressOverride(out compress)) + { + _batchCompress |= compress; + } _batchMarker = _batchStream.size(); ++_batchRequestNum; } @@ -234,6 +247,7 @@ namespace IceInternal private bool _batchStreamCanFlush; private int _batchRequestNum; private int _batchMarker; + private bool _batchCompress; private BatchRequestI _request; private Ice.LocalException _exception; private int _maxSize; |