Skip to content

Commit

Permalink
Logging cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Feb 11, 2014
1 parent bcf499e commit 487ef46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.littleshoot.proxy.impl;

import org.littleshoot.proxy.ProxyAuthenticator;
import static org.littleshoot.proxy.impl.ConnectionState.*;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
Expand Down Expand Up @@ -43,6 +42,7 @@
import org.littleshoot.proxy.FlowContext;
import org.littleshoot.proxy.FullFlowContext;
import org.littleshoot.proxy.HttpFilters;
import org.littleshoot.proxy.ProxyAuthenticator;
import org.littleshoot.proxy.SslEngineSource;

/**
Expand Down Expand Up @@ -587,7 +587,9 @@ synchronized protected void serverBecameWriteable(
@Override
protected void exceptionCaught(Throwable cause) {
String message = "Caught an exception on ClientToProxyConnection";
if (cause instanceof ClosedChannelException) {
boolean shouldWarn = cause instanceof ClosedChannelException ||
cause.getMessage().contains("Connection reset by peer");
if (shouldWarn) {
LOG.warn(message, cause);
} else {
LOG.error(message, cause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ private void rememberCurrentResponse(HttpResponse response) {
// We need to make a copy here because the response will be
// modified in various ways before we need to do things like
// analyze response headers for whether or not to close the
// connection (which may not happen for awhile for large, chunked
// connection (which may not happen for a while for large, chunked
// responses, for example).
currentHttpResponse = ProxyUtils.copyMutableResponseFields(response);
}
Expand Down

0 comments on commit 487ef46

Please sign in to comment.