diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-06-06 13:56:19 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-06-06 13:56:19 +0200 |
commit | b0b96e82b6356378c0553dc60caa000748e82f5a (patch) | |
tree | 433b46bf786ecf94c0f9e352160d4116da038f4a /csharp/src | |
parent | Update VisualStudio builder slice2cs detection (diff) | |
download | ice-b0b96e82b6356378c0553dc60caa000748e82f5a.tar.bz2 ice-b0b96e82b6356378c0553dc60caa000748e82f5a.tar.xz ice-b0b96e82b6356378c0553dc60caa000748e82f5a.zip |
Fixed ICE-7947 - fixed whenSent semantics to not depend on sentSynchronously
Diffstat (limited to 'csharp/src')
-rw-r--r-- | csharp/src/Ice/OutgoingAsync.cs | 22 | ||||
-rw-r--r-- | csharp/src/Ice/Proxy.cs | 8 |
2 files changed, 18 insertions, 12 deletions
diff --git a/csharp/src/Ice/OutgoingAsync.cs b/csharp/src/Ice/OutgoingAsync.cs index c7a30f1017b..ea08c6be130 100644 --- a/csharp/src/Ice/OutgoingAsync.cs +++ b/csharp/src/Ice/OutgoingAsync.cs @@ -18,7 +18,7 @@ namespace IceInternal { void init(OutgoingAsyncBase og); - bool handleSent(bool done, bool alreadySent); + bool handleSent(bool done, bool alreadySent, OutgoingAsyncBase og); bool handleException(Ice.Exception ex, OutgoingAsyncBase og); bool handleResponse(bool userThread, bool ok, OutgoingAsyncBase og); @@ -276,7 +276,7 @@ namespace IceInternal cacheMessageBuffers(); } - bool invoke = _completionCallback.handleSent(done, _alreadySent); + bool invoke = _completionCallback.handleSent(done, _alreadySent, this); if(!invoke && _doneInSent && observer_ != null) { observer_.detach(); @@ -1435,8 +1435,14 @@ namespace IceInternal } } - public bool handleSent(bool done, bool alreadySent) + public bool handleSent(bool done, bool alreadySent, OutgoingAsyncBase og) { + if(done && og.isSynchronous()) + { + Debug.Assert(progress_ == null); + handleInvokeSent(false, done, alreadySent, og); + return false; + } return done || progress_ != null && !alreadySent; // Invoke the sent callback only if not already invoked. } @@ -1479,14 +1485,14 @@ namespace IceInternal public virtual void handleInvokeSent(bool sentSynchronously, bool done, bool alreadySent, OutgoingAsyncBase og) { - if(done) - { - SetResult(default(T)); - } if(progress_ != null && !alreadySent) { progress_.Report(sentSynchronously); } + if(done) + { + SetResult(default(T)); + } } public void handleInvokeException(Ice.Exception ex, OutgoingAsyncBase og) @@ -1541,7 +1547,7 @@ namespace IceInternal outgoing_ = outgoing; } - public bool handleSent(bool done, bool alreadySent) + public bool handleSent(bool done, bool alreadySent, OutgoingAsyncBase og) { lock(this) { diff --git a/csharp/src/Ice/Proxy.cs b/csharp/src/Ice/Proxy.cs index 64b80c24718..8141471f56d 100644 --- a/csharp/src/Ice/Proxy.cs +++ b/csharp/src/Ice/Proxy.cs @@ -2717,14 +2717,14 @@ namespace Ice public override void handleInvokeSent(bool sentSynchronously, bool done, bool alreadySent, OutgoingAsyncBase og) { - if(done) - { - SetResult(new Object_Ice_invokeResult(true, null)); - } if(progress_ != null && !alreadySent) { progress_.Report(sentSynchronously); } + if(done) + { + SetResult(new Object_Ice_invokeResult(true, null)); + } } public override void handleInvokeResponse(bool ok, OutgoingAsyncBase og) |