Skip to content

Commit

Permalink
Flushing the buffer on line feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
opuneet committed Jan 7, 2013
1 parent 2e11926 commit bebb90d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
while ((b = is.read()) != -1) {
try {
os.write(b);
if (b == 10 /** flush buffer on line feed */) {
os.flush();
}
} catch (Exception e) {
if (e.getClass().getSimpleName().equalsIgnoreCase("ClientAbortException")) {
// don't throw an exception as this means the user closed the connection
Expand Down

0 comments on commit bebb90d

Please sign in to comment.