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 2019/05/31 17:51:09 UTC

[httpcomponents-core] 06/06: Fixed parameter inconsistency in server side push APIs

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch message-support
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 1a3aff635fa20101373412d1b56ae1b4bd96de1f
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Fri May 31 19:45:16 2019 +0200

    Fixed parameter inconsistency in server side push APIs
---
 .../org/apache/hc/core5/http2/impl/nio/ServerHttp2StreamHandler.java  | 2 +-
 .../apache/hc/core5/http2/impl/nio/ServerPushHttp2StreamHandler.java  | 2 +-
 .../org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java   | 2 +-
 .../src/main/java/org/apache/hc/core5/http/nio/ResponseChannel.java   | 4 ++--
 .../hc/core5/http/nio/support/AbstractServerExchangeHandler.java      | 2 +-
 .../nio/support/AsyncServerFilterChainExchangeHandlerFactory.java     | 2 +-
 .../apache/hc/core5/http/nio/support/TerminalAsyncServerFilter.java   | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttp2StreamHandler.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttp2StreamHandler.java
index 6e5c7ec..70f02fb 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttp2StreamHandler.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerHttp2StreamHandler.java
@@ -227,7 +227,7 @@ public class ServerHttp2StreamHandler implements Http2StreamHandler {
 
                     @Override
                     public void pushPromise(
-                            final HttpRequest promise, final HttpContext httpContext, final AsyncPushProducer pushProducer) throws HttpException, IOException {
+                            final HttpRequest promise, final AsyncPushProducer pushProducer, final HttpContext httpContext) throws HttpException, IOException {
                         commitPromise(promise, pushProducer);
                     }
 
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerPushHttp2StreamHandler.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerPushHttp2StreamHandler.java
index 9af9c34..374441e 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerPushHttp2StreamHandler.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerPushHttp2StreamHandler.java
@@ -215,7 +215,7 @@ class ServerPushHttp2StreamHandler implements Http2StreamHandler {
 
                     @Override
                     public void pushPromise(
-                            final HttpRequest promise, final HttpContext httpContext, final AsyncPushProducer pushProducer) throws HttpException, IOException {
+                            final HttpRequest promise, final AsyncPushProducer pushProducer, final HttpContext httpContext) throws HttpException, IOException {
                         commitPromise(promise, pushProducer);
                     }
 
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
index 12c986d..b9f8146 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ServerHttp1StreamHandler.java
@@ -237,7 +237,7 @@ class ServerHttp1StreamHandler implements ResourceHolder {
 
             @Override
             public void pushPromise(
-                    final HttpRequest promise, final HttpContext httpContext, final AsyncPushProducer pushProducer) throws HttpException, IOException {
+                    final HttpRequest promise, final AsyncPushProducer pushProducer, final HttpContext httpContext) throws HttpException, IOException {
                 commitPromise();
             }
 
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/ResponseChannel.java b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/ResponseChannel.java
index c18a8e6..930f20e 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/ResponseChannel.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/ResponseChannel.java
@@ -71,9 +71,9 @@ public interface ResponseChannel {
      * a response message.
      *
      * @param promise the request message header used as a promise.
-     * @param context the actual execution context.
      * @param responseProducer the push response message producer.
+     * @param context the actual execution context.
      */
-    void pushPromise(HttpRequest promise, HttpContext context, AsyncPushProducer responseProducer) throws HttpException, IOException;
+    void pushPromise(HttpRequest promise, AsyncPushProducer responseProducer, HttpContext context) throws HttpException, IOException;
 
 }
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/AbstractServerExchangeHandler.java b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/AbstractServerExchangeHandler.java
index 160182e..0e2c3c4 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/AbstractServerExchangeHandler.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/AbstractServerExchangeHandler.java
@@ -121,7 +121,7 @@ public abstract class AbstractServerExchangeHandler<T> implements AsyncServerExc
             @Override
             public void pushPromise(
                     final HttpRequest promise, final HttpContext httpContext, final AsyncPushProducer pushProducer) throws HttpException, IOException {
-                responseChannel.pushPromise(promise, httpContext, pushProducer);
+                responseChannel.pushPromise(promise, pushProducer, httpContext);
             }
 
             @Override
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/AsyncServerFilterChainExchangeHandlerFactory.java b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/AsyncServerFilterChainExchangeHandlerFactory.java
index 216426e..faaa6ff 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/AsyncServerFilterChainExchangeHandlerFactory.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/AsyncServerFilterChainExchangeHandlerFactory.java
@@ -97,7 +97,7 @@ public final class AsyncServerFilterChainExchangeHandlerFactory implements Handl
 
                     @Override
                     public void pushPromise(final HttpRequest promise, final AsyncPushProducer responseProducer) throws HttpException, IOException {
-                        responseChannel.pushPromise(promise, context, responseProducer);
+                        responseChannel.pushPromise(promise, responseProducer, context);
                     }
 
                 }));
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/TerminalAsyncServerFilter.java b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/TerminalAsyncServerFilter.java
index 04ba5c3..3ce1196 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/TerminalAsyncServerFilter.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/TerminalAsyncServerFilter.java
@@ -140,7 +140,7 @@ public final class TerminalAsyncServerFilter implements AsyncFilterHandler {
                 }
 
                 @Override
-                public void pushPromise(final HttpRequest promise, final HttpContext httpContext, final AsyncPushProducer pushProducer) throws HttpException, IOException {
+                public void pushPromise(final HttpRequest promise, final AsyncPushProducer pushProducer, final HttpContext httpContext) throws HttpException, IOException {
                     responseTrigger.pushPromise(promise, pushProducer);
                 }