EWS: disable gzip encoding if WIRE logging is at DEBUG level

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1971 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2012-06-25 22:33:58 +00:00
parent 599c0de815
commit 3c534221f5
1 changed files with 3 additions and 1 deletions

View File

@ -28,6 +28,7 @@ import org.apache.commons.codec.binary.Base64;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.codehaus.stax2.typed.TypedXMLStreamReader;
@ -107,7 +108,8 @@ public abstract class EWSMethod extends PostMethod {
this.itemType = itemType;
this.methodName = methodName;
this.responseCollectionName = responseCollectionName;
if (Settings.getBooleanProperty("davmail.acceptEncodingGzip", true)) {
if (Settings.getBooleanProperty("davmail.acceptEncodingGzip", true) &&
!Level.DEBUG.toString().equals(Settings.getBooleanProperty("log4j.logger.httpclient.wire"))) {
setRequestHeader("Accept-Encoding", "gzip");
}
setRequestEntity(new RequestEntity() {