You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/02/05 18:58:38 UTC
[httpcomponents-core] branch master updated: HTTPCORE-666,
regression: fixed NPE in ServerHttp1IOEventHandlerFactory
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
The following commit(s) were added to refs/heads/master by this push:
new 69133eb HTTPCORE-666, regression: fixed NPE in ServerHttp1IOEventHandlerFactory
69133eb is described below
commit 69133eb372906334f9dad2b86f2748d0c0acb941
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Fri Feb 5 19:32:06 2021 +0100
HTTPCORE-666, regression: fixed NPE in ServerHttp1IOEventHandlerFactory
---
.../http/impl/nio/ServerHttp1IOEventHandlerFactory.java | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1IOEventHandlerFactory.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1IOEventHandlerFactory.java
index 111f615..ef3a32f 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1IOEventHandlerFactory.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1IOEventHandlerFactory.java
@@ -75,13 +75,15 @@ public class ServerHttp1IOEventHandlerFactory implements IOEventHandlerFactory {
handshakeTimeout);
}
} else {
- tlsStrategy.upgrade(
- ioSession,
- null,
- ioSession.getLocalAddress(),
- ioSession.getRemoteAddress(),
- attachment,
- handshakeTimeout);
+ if (tlsStrategy != null) {
+ tlsStrategy.upgrade(
+ ioSession,
+ null,
+ ioSession.getLocalAddress(),
+ ioSession.getRemoteAddress(),
+ attachment,
+ handshakeTimeout);
+ }
}
return new ServerHttp1IOEventHandler(streamDuplexerFactory.create(endpointScheme, ioSession));
}