tomaswolf opened a new pull request, #259: URL: https://github.com/apache/mina-sshd/pull/259
When channel data is received, the window size must be decremented right away. If we do this only once we've processed the received data, it's possible that we buffer a lot data if the peer (by mistake or malicious intent) ignores our window and just keeps on sending data. However, sending back a SSH_MSG_CHANNEL_WINDOW_ADJUST message must occur only after the received data has been processed or forwarded. Make Window an abstract class, and have two concrete subclasses for RemoteWindow and LocalWindow. This is safer, since we should never call check() on a remote window, or expand() on a local window. Also, do not let Window implement java.nio.channel.Channel. Just because it has a close() and an isOpen() method, a Window is not a channel. Change all uses appropriately and replace all calls to consumeAndCheck() by check(). In AbstractChannel, call consume() right away when data is received on the SSH channel. Refactor the way a channel's writePacket() method decides whether to write a packet. Introduce a new mayWrite() method so that less overriding in subclasses of AbstractChannel is needed when asynchronous streams are needed. (In that case, there may be pending writes that may need to be flushed, so writing must not stop on isClosing() but only on isClosed().) -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
