summaryrefslogtreecommitdiff
path: root/java/src/Ice/ConnectionI.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2010-08-09 10:27:16 +0200
committerBenoit Foucher <benoit@zeroc.com>2010-08-09 10:27:16 +0200
commitf3d2ae7838e6fedd3b97e3766690c1f0bc971eaa (patch)
treeb7f37937b63920fc760b37025e383323629a6732 /java/src/Ice/ConnectionI.java
parentbug 4816: Ruby bug in pretty-printing sequence<byte> string (diff)
downloadice-f3d2ae7838e6fedd3b97e3766690c1f0bc971eaa.tar.bz2
ice-f3d2ae7838e6fedd3b97e3766690c1f0bc971eaa.tar.xz
ice-f3d2ae7838e6fedd3b97e3766690c1f0bc971eaa.zip
Fixed bug 4817 - AMI crash/timeout
Diffstat (limited to 'java/src/Ice/ConnectionI.java')
-rw-r--r--java/src/Ice/ConnectionI.java43
1 files changed, 26 insertions, 17 deletions
diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java
index c5495894892..5992d297464 100644
--- a/java/src/Ice/ConnectionI.java
+++ b/java/src/Ice/ConnectionI.java
@@ -1263,29 +1263,38 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne
_startCallback = null;
}
- //
- // NOTE: for twoway requests which are not sent, finished can be called twice: the
- // first time because the outgoing is in the _sendStreams set and the second time
- // because it's either in the _requests/_asyncRequests set. This is fine, only the
- // first call should be taken into account by the implementation of finished.
- //
-
- for(OutgoingMessage p : _sendStreams)
+ if(!_sendStreams.isEmpty())
{
- if(p.requestId > 0)
+ //
+ // Return the stream to the outgoing call. This is important for
+ // retriable AMI calls which are not marshalled again.
+ //
+ OutgoingMessage message = _sendStreams.getFirst();
+ _writeStream.swap(message.stream);
+
+ //
+ // NOTE: for twoway requests which are not sent, finished can be called twice: the
+ // first time because the outgoing is in the _sendStreams set and the second time
+ // because it's either in the _requests/_asyncRequests set. This is fine, only the
+ // first call should be taken into account by the implementation of finished.
+ //
+ for(OutgoingMessage p : _sendStreams)
{
- if(p.out != null) // Make sure finished isn't called twice.
+ if(p.requestId > 0)
{
- _requests.remove(p.requestId);
- }
- else
- {
- _asyncRequests.remove(p.requestId);
+ if(p.out != null) // Make sure finished isn't called twice.
+ {
+ _requests.remove(p.requestId);
+ }
+ else
+ {
+ _asyncRequests.remove(p.requestId);
+ }
}
+ p.finished(_exception);
}
- p.finished(_exception);
+ _sendStreams.clear();
}
- _sendStreams.clear();
for(IceInternal.Outgoing p : _requests.values())
{