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 2018/04/12 13:35:48 UTC
[1/2] httpcomponents-core git commit: Removed optional protocol layer
and transport security layer interfaces from AbstractHttp1StreamDuplexer
Repository: httpcomponents-core
Updated Branches:
refs/heads/master 24b8e9263 -> 409eda4a1
Removed optional protocol layer and transport security layer interfaces from AbstractHttp1StreamDuplexer
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/f1e04cd5
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/f1e04cd5
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/f1e04cd5
Branch: refs/heads/master
Commit: f1e04cd56fbba882873e62736c71b70103ea5c3f
Parents: 24b8e92
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Thu Apr 12 15:25:12 2018 +0200
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Thu Apr 12 15:25:12 2018 +0200
----------------------------------------------------------------------
.../impl/nio/AbstractHttp1StreamDuplexer.java | 33 +-------------
.../impl/nio/UpgradeableHttpConnection.java | 47 --------------------
2 files changed, 1 insertion(+), 79 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f1e04cd5/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
index f363212..22672fd 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
@@ -40,7 +40,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
-import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import org.apache.hc.core5.http.ConnectionClosedException;
@@ -75,19 +74,13 @@ import org.apache.hc.core5.http.nio.command.ShutdownCommand;
import org.apache.hc.core5.io.ShutdownType;
import org.apache.hc.core5.reactor.Command;
import org.apache.hc.core5.reactor.EventMask;
-import org.apache.hc.core5.reactor.IOEventHandler;
import org.apache.hc.core5.reactor.ProtocolIOSession;
-import org.apache.hc.core5.reactor.ProtocolLayer;
-import org.apache.hc.core5.reactor.ssl.SSLBufferManagement;
-import org.apache.hc.core5.reactor.ssl.SSLSessionInitializer;
-import org.apache.hc.core5.reactor.ssl.SSLSessionVerifier;
import org.apache.hc.core5.reactor.ssl.TlsDetails;
-import org.apache.hc.core5.reactor.ssl.TransportSecurityLayer;
import org.apache.hc.core5.util.Args;
import org.apache.hc.core5.util.Identifiable;
abstract class AbstractHttp1StreamDuplexer<IncomingMessage extends HttpMessage, OutgoingMessage extends HttpMessage>
- implements Identifiable, ResourceHolder, TransportSecurityLayer, ProtocolLayer, HttpConnection {
+ implements Identifiable, HttpConnection, ResourceHolder {
private enum ConnectionState { READY, ACTIVE, GRACEFUL_SHUTDOWN, SHUTDOWN}
@@ -611,28 +604,4 @@ abstract class AbstractHttp1StreamDuplexer<IncomingMessage extends HttpMessage,
return tlsDetails != null ? tlsDetails.getSSLSession() : null;
}
- @Override
- public TlsDetails getTlsDetails() {
- return ioSession.getTlsDetails();
- }
-
- @Override
- public void startTls(
- final SSLContext sslContext,
- final SSLBufferManagement sslBufferManagement,
- final SSLSessionInitializer initializer,
- final SSLSessionVerifier verifier) throws UnsupportedOperationException {
- ioSession.startTls(sslContext, sslBufferManagement, initializer, verifier);
- }
-
- @Override
- public IOEventHandler getHandler() {
- return ioSession.getHandler();
- }
-
- @Override
- public void upgrade(final IOEventHandler eventHandler) {
- ioSession.upgrade(eventHandler);
- }
-
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f1e04cd5/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/UpgradeableHttpConnection.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/UpgradeableHttpConnection.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/UpgradeableHttpConnection.java
deleted file mode 100644
index a5fb197..0000000
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/UpgradeableHttpConnection.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.core5.http.impl.nio;
-
-import org.apache.hc.core5.http.HttpConnection;
-import org.apache.hc.core5.reactor.IOEventHandler;
-import org.apache.hc.core5.reactor.ssl.TransportSecurityLayer;
-
-/**
- * Represents an HTTP/1.1 connection capable of upgrading its transport security
- * and communication protocol.
- *
- * @see TransportSecurityLayer
- * @see IOEventHandler
- *
- * @since 5.0
- */
-public interface UpgradeableHttpConnection extends HttpConnection, TransportSecurityLayer {
-
- void upgrade(IOEventHandler eventHandler);
-
-}
[2/2] httpcomponents-core git commit: Made resource handling of
AbstractHttp1StreamDuplexer consistent with that of
AbstractHttp2StreamMultiplexer;
AbstractHttp1StreamDuplexer no longer implements ResourceHolder
Posted by ol...@apache.org.
Made resource handling of AbstractHttp1StreamDuplexer consistent with that of AbstractHttp2StreamMultiplexer; AbstractHttp1StreamDuplexer no longer implements ResourceHolder
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/409eda4a
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/409eda4a
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/409eda4a
Branch: refs/heads/master
Commit: 409eda4a1de149cc69b39a0f091cbb43c195d5c1
Parents: f1e04cd
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Wed Mar 28 20:36:38 2018 +0200
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Thu Apr 12 15:33:28 2018 +0200
----------------------------------------------------------------------
.../impl/nio/AbstractHttp1StreamDuplexer.java | 5 +----
.../impl/nio/ClientHttp1StreamDuplexer.java | 20 --------------------
.../impl/nio/ServerHttp1StreamDuplexer.java | 20 --------------------
3 files changed, 1 insertion(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/409eda4a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
index 22672fd..f5d8064 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
@@ -66,7 +66,6 @@ import org.apache.hc.core5.http.nio.ContentDecoder;
import org.apache.hc.core5.http.nio.ContentEncoder;
import org.apache.hc.core5.http.nio.NHttpMessageParser;
import org.apache.hc.core5.http.nio.NHttpMessageWriter;
-import org.apache.hc.core5.http.nio.ResourceHolder;
import org.apache.hc.core5.http.nio.SessionInputBuffer;
import org.apache.hc.core5.http.nio.SessionOutputBuffer;
import org.apache.hc.core5.http.nio.command.ExecutionCommand;
@@ -80,7 +79,7 @@ import org.apache.hc.core5.util.Args;
import org.apache.hc.core5.util.Identifiable;
abstract class AbstractHttp1StreamDuplexer<IncomingMessage extends HttpMessage, OutgoingMessage extends HttpMessage>
- implements Identifiable, HttpConnection, ResourceHolder {
+ implements Identifiable, HttpConnection {
private enum ConnectionState { READY, ACTIVE, GRACEFUL_SHUTDOWN, SHUTDOWN}
@@ -388,7 +387,6 @@ abstract class AbstractHttp1StreamDuplexer<IncomingMessage extends HttpMessage,
}
if (connState.compareTo(ConnectionState.SHUTDOWN) >= 0) {
ioSession.close();
- releaseResources();
}
}
@@ -432,7 +430,6 @@ abstract class AbstractHttp1StreamDuplexer<IncomingMessage extends HttpMessage,
break;
}
}
- releaseResources();
}
void requestShutdown(final ShutdownType shutdownType) {
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/409eda4a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java
index 67559b5..911910b 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ClientHttp1StreamDuplexer.java
@@ -167,26 +167,6 @@ public class ClientHttp1StreamDuplexer extends AbstractHttp1StreamDuplexer<HttpR
}
@Override
- public void releaseResources() {
- if (incoming != null) {
- incoming.releaseResources();
- incoming = null;
- }
- if (outgoing != null) {
- outgoing.releaseResources();
- outgoing = null;
- }
- for (;;) {
- final ClientHttp1StreamHandler handler = pipeline.poll();
- if (handler != null) {
- handler.releaseResources();
- } else {
- break;
- }
- }
- }
-
- @Override
void terminate(final Exception exception) {
if (incoming != null) {
incoming.failed(exception);
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/409eda4a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java
index f2fcc42..b277da2 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamDuplexer.java
@@ -167,26 +167,6 @@ public class ServerHttp1StreamDuplexer extends AbstractHttp1StreamDuplexer<HttpR
}
@Override
- public void releaseResources() {
- if (incoming != null) {
- incoming.releaseResources();
- incoming = null;
- }
- if (outgoing != null) {
- outgoing.releaseResources();
- outgoing = null;
- }
- for (;;) {
- final ServerHttp1StreamHandler handler = pipeline.poll();
- if (handler != null) {
- handler.releaseResources();
- } else {
- break;
- }
- }
- }
-
- @Override
void terminate(final Exception exception) {
if (incoming != null) {
incoming.failed(exception);