TOMEE-1623 only apply this to https connections

Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/43c69b2c
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/43c69b2c
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/43c69b2c

Branch: refs/heads/tomee-1.7.x
Commit: 43c69b2cc49c75c9fd3a616c6835d70be911b080
Parents: 6e8a023
Author: Jonathan Gallimore <[email protected]>
Authored: Mon Aug 29 00:47:15 2016 +0100
Committer: Jonathan Gallimore <[email protected]>
Committed: Mon Aug 29 00:47:15 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/openejb/client/Client.java  | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/43c69b2c/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java
----------------------------------------------------------------------
diff --git 
a/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java 
b/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java
index 2e9a1d0..097dc4c 100644
--- a/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java
+++ b/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java
@@ -406,14 +406,20 @@ public class Client {
 
             if (null != in) {
 
-                // consume anything left in the buffer
-                try {
-                    int read = 0;
-                    while (read > -1) {
-                        read = in.read();
+                // consume anything left in the buffer if we're running in 
http(s) mode
+                if 
(HttpConnectionFactory.HttpConnection.class.isInstance(conn)) {
+                    final HttpConnectionFactory.HttpConnection httpConnection 
= HttpConnectionFactory.HttpConnection.class.cast(conn);
+                    if 
("https".equalsIgnoreCase(httpConnection.getURI().getScheme())) {
+
+                        try {
+                            int read = 0;
+                            while (read > -1) {
+                                read = in.read();
+                            }
+                        } catch (Throwable e) {
+                            // ignore
+                        }
                     }
-                } catch (Throwable e) {
-                    // ignore
                 }
 
                 try {

Reply via email to