lgoldstein commented on a change in pull request #123:
URL: https://github.com/apache/mina-sshd/pull/123#discussion_r412199074



##########
File path: 
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
##########
@@ -954,7 +954,9 @@ protected IoWriteFuture doWritePacket(Buffer buffer) throws 
IOException {
         synchronized (encodeLock) {
             Buffer packet = resolveOutputPacket(buffer);
             IoSession networkSession = getIoSession();
-            return networkSession.writePacket(packet);
+            IoWriteFuture future = networkSession.writePacket(packet);
+            buffer.rpos(buffer.wpos());
+            return future;

Review comment:
       >> Ok, so the problem is in the assumptions about the writePacket.
   
   I did not mean that there is any problem with the call since the packet is 
obviously a different instance than the original buffer. If there is some 
similar optimization that needs to be done on the packet then indeed we need to 
make it **after** being informed (via a listener) that the packet has been 
consumed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to