Don't write decoded stuff if not needed

pull/17/head
Ludovic Marcotte 2014-01-10 14:53:49 -05:00
parent 68dafdfdeb
commit e8438a6235
1 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,8 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVE
#include <wbxml_conv.h> #include <wbxml_conv.h>
#include <wbxml_errors.h> #include <wbxml_errors.h>
#define WBXMLDEBUG 0
@implementation NSData (ActiveSync) @implementation NSData (ActiveSync)
- (NSData *) wbxml2xml - (NSData *) wbxml2xml
@ -54,7 +56,10 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVE
} }
data = [[NSData alloc] initWithBytes: xml length: xml_len]; data = [[NSData alloc] initWithBytes: xml length: xml_len];
#if WBXMLDEBUG
[data writeToFile: @"/tmp/protocol.decoded" atomically: YES]; [data writeToFile: @"/tmp/protocol.decoded" atomically: YES];
#endif
free(xml); free(xml);
@ -101,7 +106,10 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVE
} }
data = [[NSData alloc] initWithBytes: wbxml length: wbxml_len]; data = [[NSData alloc] initWithBytes: wbxml length: wbxml_len];
#if WBXMLDEBUG
[data writeToFile: @"/tmp/protocol.encoded" atomically: YES]; [data writeToFile: @"/tmp/protocol.encoded" atomically: YES];
#endif
free(wbxml); free(wbxml);
wbxml_conv_xml2wbxml_destroy(conv); wbxml_conv_xml2wbxml_destroy(conv);