From 5ae84edb11f119120d57e649bc218a565a247087 Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Wed, 8 Oct 2014 01:59:36 +0200 Subject: Supress printing very long plists and too verbose messages in debug output --- src/asr.c | 2 +- src/common.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/asr.c b/src/asr.c index 4269563..591b908 100644 --- a/src/asr.c +++ b/src/asr.c @@ -176,7 +176,7 @@ int asr_send_buffer(asr_client_t asr, const char* data, uint32_t size) { return -1; } - debug("Sent %d bytes buffer\n", bytes); + //debug("Sent %d bytes buffer\n", bytes); return 0; } diff --git a/src/common.c b/src/common.c index 49df778..f889087 100644 --- a/src/common.c +++ b/src/common.c @@ -30,6 +30,8 @@ #include "common.h" +#define MAX_PRINT_LEN 64*1024 + int idevicerestore_debug = 0; #define idevicerestore_err_buff_size 256 @@ -186,7 +188,10 @@ void debug_plist(plist_t plist) { uint32_t size = 0; char* data = NULL; plist_to_xml(plist, &data, &size); - info("%s", data); + if (size <= MAX_PRINT_LEN) + info("%s:printing %i bytes plist:\n%s", __FILE__, size, data); + else + info("%s:supressed printing %i bytes plist...\n", __FILE__, size); free(data); } -- cgit v1.1-32-gdbae