Repository: tomee
Updated Branches:
  refs/heads/master c1358ae73 -> a26d99040


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/a26d9904
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/a26d9904
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/a26d9904

Branch: refs/heads/master
Commit: a26d9904092503fa4e2ef21532a510388b159891
Parents: c1358ae
Author: Jonathan Gallimore <j...@jrg.me.uk>
Authored: Mon Aug 29 00:47:15 2016 +0100
Committer: Jonathan Gallimore <j...@jrg.me.uk>
Committed: Mon Aug 29 10:15:11 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/openejb/client/Client.java  | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/a26d9904/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 0fd3be6..d017e7f 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
@@ -404,6 +404,31 @@ public class Client {
                 }
             }
 
+            if (null != in) {
+
+                // 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
+                        }
+                    }
+                }
+
+                try {
+                    in.close();
+                } catch (final Throwable e) {
+                    //Ignore
+                }
+            }
+
             if (null != conn) {
                 try {
                     conn.close();

Reply via email to