(fix) only dump broken eas data to file if SOGoEASDebugEnabled is enabled

pull/87/head
Ludovic Marcotte 2015-05-29 14:23:01 -04:00
parent 6cf2fd1e52
commit 7da6b0b822
1 changed files with 13 additions and 4 deletions

View File

@ -32,6 +32,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Foundation/NSProcessInfo.h> #import <Foundation/NSProcessInfo.h>
#import <Foundation/NSString.h> #import <Foundation/NSString.h>
#import <SOGo/SOGoSystemDefaults.h>
#import <NGExtensions/NGBase64Coding.h> #import <NGExtensions/NGBase64Coding.h>
#import <NGExtensions/NSObject+Logs.h> #import <NGExtensions/NSObject+Logs.h>
@ -44,6 +46,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@implementation NSData (ActiveSync) @implementation NSData (ActiveSync)
- (void) _dumpToFile - (void) _dumpToFile
{
BOOL debugOn;
debugOn = [[SOGoSystemDefaults sharedSystemDefaults] easDebugEnabled];
if (debugOn)
{ {
NSString *path; NSString *path;
@ -51,6 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[self writeToFile: path atomically: YES]; [self writeToFile: path atomically: YES];
[self errorWithFormat: @"Original data written to: %@", path]; [self errorWithFormat: @"Original data written to: %@", path];
} }
}
// //
// Encodes the data in base64 and strip newline characters // Encodes the data in base64 and strip newline characters