ggrandes commented on a change in pull request #141:
URL: https://github.com/apache/mina-sshd/pull/141#discussion_r454549097
##########
File path:
sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultForwardingFilter.java
##########
@@ -974,22 +975,36 @@ protected void preClose() {
super.preClose();
}
+ private IoAcceptor createIoAcceptor(Factory<? extends IoHandler>
handlerFactory) {
+ Session session = getSession();
+ FactoryManager manager =
Objects.requireNonNull(session.getFactoryManager(), "No factory manager");
+ IoServiceFactory factory =
Objects.requireNonNull(manager.getIoServiceFactory(), "No I/O service factory");
+ IoHandler handler = handlerFactory.create();
+ return factory.createAcceptor(handler);
+ }
+
+ private IoAcceptor getLocalIoAcceptor(Factory<? extends IoHandler>
handlerFactory) {
+ if (localAcceptor == null) {
+ localAcceptor = createIoAcceptor(handlerFactory);
+ }
+ return localAcceptor;
+ }
+
+ private IoAcceptor getDynamicIoAcceptor(Factory<? extends IoHandler>
handlerFactory) {
Review comment:
The original caller `doBind` is `private` too; must be changed to
`protected` too to facilitate this overriding?
##########
File path:
sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultForwardingFilter.java
##########
@@ -964,7 +965,7 @@ protected void invokePortEventListenerSignallerHolders(
@Override
protected synchronized Closeable getInnerCloseable() {
- return builder().parallel(toString(),
dynamicLocal.values()).close(acceptor).build();
+ return builder().parallel(toString(),
dynamicLocal.values()).close(dynamicAcceptor).build();
Review comment:
It is possible, but honestly, I don't know the sshd code enough and I
just let myself be guided by that `dynamicLocal.values()`
----------------------------------------------------------------
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]