Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

fix crash #573

Merged
merged 1 commit into from
Nov 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.SocketException;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.util.zip.GZIPOutputStream;
Expand Down Expand Up @@ -81,14 +82,21 @@
* </p>
*
* <p>
* Version 1.2
* <ul>
* <li>Fixed crash - java.net.SocketException: Broken pipe</li>
* </ul>
* </p>
*
* <p>
* Thread safety: Technically this class is NOT thread safe since it has mutable states, but the intended
* usage of the mutators is for IoC injection and thus we expect for these values not to be changed after
* initialization. Thus this class can be considered as thread-safe conditional in an IoC injection usage of
* the mutators.
* </p>
*
* @author AleaActaEst, TCSDEVELOPER, duxiaoyang
* @version 1.1
* @version 1.2
*/
@SuppressWarnings("serial")
public class CustomFormatAJAXResult implements Result {
Expand Down Expand Up @@ -300,11 +308,13 @@ private static void writeDataAndClose(InputStream in, OutputStream out) throws I
}
// flush output stream
out.flush();
} catch (SocketException e) {
// The client side has aborted or closed connection
} finally {
// close the input stream
closeStream(in);
// close the output stream
out.close();
closeStream(out);
}
}

Expand Down