Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
* 减少错误日志产生(停止下载)
Browse files Browse the repository at this point in the history
  • Loading branch information
eritpchy committed Sep 10, 2021
1 parent 9714d62 commit d5e410f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
httpServletResponse.flushBuffer();
} catch (Throwable t) {
httpServletResponse.setStatus(500);
httpServletResponse.getWriter().write(t.getMessage());
try {
httpServletResponse.getWriter().write(String.valueOf(t.getMessage()));
} catch (Throwable ignore) {
}
httpServletResponse.flushBuffer();
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/sf/webdav/methods/DoGet.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import net.sf.webdav.WebdavStatus;
import net.sf.webdav.locking.ResourceLocks;
import org.apache.commons.io.IOUtils;
import org.eclipse.jetty.io.EofException;

public class DoGet extends DoHead {

Expand Down Expand Up @@ -79,13 +80,12 @@ protected void doBody(ITransaction transaction, HttpServletResponse resp,
IOUtils.closeQuietly(in);
try {
bos.flush();
} catch (Exception e) {
LOG.warn("{} Flushing OutputStream causes Exception!\n", path
,e);
} catch (Exception ignored) {
}
IOUtils.closeQuietly(bos);
IOUtils.closeQuietly(out);
}
} catch (EofException ignore) {
} catch (Exception e) {
LOG.warn("{} doBody causes Exception!\n", path
,e);
Expand Down

0 comments on commit d5e410f

Please sign in to comment.