You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Goldstein Lyor (JIRA)" <ji...@apache.org> on 2017/10/14 15:18:01 UTC

[jira] [Comment Edited] (SSHD-778) Allow overiding WAIT_FOR_SPACE_TIMEOUT and DEFAULT_WAIT_FOR_SPACE_TIMEOUT default setting

    [ https://issues.apache.org/jira/browse/SSHD-778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16204660#comment-16204660 ] 

Goldstein Lyor edited comment on SSHD-778 at 10/14/17 3:17 PM:
---------------------------------------------------------------

I don't see the need for it - the call in {{ChannelOutputStream}} already does this - and more
{code:java}
public ChannelOutputStream(AbstractChannel channel, Window remoteWindow, Logger log, byte cmd, boolean eofOnClose) {
        this(channel, remoteWindow, channel.getLongProperty(WAIT_FOR_SPACE_TIMEOUT, DEFAULT_WAIT_FOR_SPACE_TIMEOUT), log, cmd, eofOnClose);
    }
{code}

If you look at the implementation of {{channel.getLongProperty}} you will see that it behaves as documented in the project's documentation:
{quote:title=Properties and inheritance model}
If a channel requires some parameter in order to decide how to behave, then the following configuration hierarchy is consulted:

* The channel-specific configuration
* The "owning" session configuration
* The "owning" client/server instance configuration
* The system properties - Note: any configuration value required by the code can be provided via a system property bearing the org.apache.sshd.config prefix - see SyspropsMapWrapper for the implementation details.
{quote}

Which means that the code does *exactly* what you asked - it just gives you greater control over where to place the property - at the channel/session/factory manager/system property level - whichever suits your needs best. Therefore, all you have to do is
{code:java}
SshServer server = ...setupServer...
PropertyResolverUtils.updateProperty(server, ChannelOutputStream.WAIT_FOR_SPACE_TIMEOUT, ..whatever value you want...);
// P.S. the same applies to an SshClient instance...
{code}
I am therefore closing this issue - please feel free to re-open if the code does not behave in the manner I have described.


was (Author: lgoldstein):
I don't see the need for it - the call in {{ChannelOutputStream}} already does this - and more
{code:java}
public ChannelOutputStream(AbstractChannel channel, Window remoteWindow, Logger log, byte cmd, boolean eofOnClose) {
        this(channel, remoteWindow, channel.getLongProperty(WAIT_FOR_SPACE_TIMEOUT, DEFAULT_WAIT_FOR_SPACE_TIMEOUT), log, cmd, eofOnClose);
    }
{code}

If you look at the implementation of {{channel.getLongProperty}} you will see that it behaves as documented in the project's documentation:
{quote:title=Properties and inheritance model}
If a channel requires some parameter in order to decide how to behave, then the following configuration hierarchy is consulted:

* The channel-specific configuration
* The "owning" session configuration
* The "owning" client/server instance configuration
* The system properties - Note: any configuration value required by the code can be provided via a system property bearing the org.apache.sshd.config prefix - see SyspropsMapWrapper for the implementation details.
{quote}

Which means that the code does *exactly* what you asked - it just gives you greater control over where to place the property - at the channel/session/factory manager/system property level - whichever suits your needs best. Therefore, all you have to do is
{code:java}
SshServer server = ...setupServer...
PropertyResolverUtils.updateProperty(ChannelOutputStream.WAIT_FOR_SPACE_TIMEOUT, ..whatever value you want...);
// P.S. the same applies to an SshClient instance...
{code}
I am therefore closing this issue - please feel free to re-open if the code does not behave in the manner I have described.

> Allow overiding WAIT_FOR_SPACE_TIMEOUT and DEFAULT_WAIT_FOR_SPACE_TIMEOUT default setting
> -----------------------------------------------------------------------------------------
>
>                 Key: SSHD-778
>                 URL: https://issues.apache.org/jira/browse/SSHD-778
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.6.0
>            Reporter: none
>            Assignee: Goldstein Lyor
>              Labels: sshd
>             Fix For: 1.4.0
>
>
> Hi, could the ability to overide the defaults for DEFAULT_WAIT_FOR_SPACE_TIMEOUT and WAIT_FOR_SPACE_TIMEOUT be supported please?
> This would allow a project like gerrit to set it's own default but also allow users to set it's own too.
> These constants should be moved to the FactoryManager.
> See https://bugs.chromium.org/p/gerrit/issues/detail?id=7425



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)