diff options
author | Martin Szulecki | 2010-07-09 23:38:53 +0200 |
---|---|---|
committer | Martin Szulecki | 2010-07-09 23:38:53 +0200 |
commit | 9433af8a8c8f6d8718712d59547d3c333402551b (patch) | |
tree | a18af2474b8b49c39457a8081cdbe9773a0e623c | |
parent | 853e499d97d2dd0c2b9dcc0ff3398f0295832132 (diff) | |
download | idevicerestore-9433af8a8c8f6d8718712d59547d3c333402551b.tar.gz idevicerestore-9433af8a8c8f6d8718712d59547d3c333402551b.tar.bz2 |
Only debug a plist if debugging flag was set
-rw-r--r-- | src/asr.c | 9 | ||||
-rw-r--r-- | src/restore.c | 12 |
2 files changed, 15 insertions, 6 deletions
@@ -87,7 +87,9 @@ int asr_receive(idevice_connection_t asr, plist_t* data) { *data = request; - debug("Received %d bytes:\n%s\n", size, buffer); + debug("Received %d bytes:\n", size); + if (idevicerestore_debug) + debug_plist(request); free(buffer); return 0; } @@ -104,7 +106,8 @@ int asr_send(idevice_connection_t asr, plist_t* data) { } debug("Sent %d bytes:\n", size); - debug_plist(data); + if (idevicerestore_debug) + debug_plist(*data); free(buffer); return 0; } @@ -119,6 +122,8 @@ int asr_send_buffer(idevice_connection_t asr, const char* data, uint32_t size) { return -1; } + debug("Sent %d bytes buffer\n", bytes); + return 0; } diff --git a/src/restore.c b/src/restore.c index 0916665..0170ac3 100644 --- a/src/restore.c +++ b/src/restore.c @@ -559,7 +559,8 @@ int restore_send_nor(restored_client_t restore, struct idevicerestore_client_t* } plist_dict_insert_item(dict, "NorImageData", norimage_array); - debug_plist(dict); + if (idevicerestore_debug) + debug_plist(dict); ret = restored_send(restore, dict); if (ret != RESTORE_E_SUCCESS) { @@ -610,7 +611,8 @@ int restore_handle_data_request_msg(struct idevicerestore_client_t* client, idev } else { // Unknown DataType!! debug("Unknown data request received\n"); - debug_plist(message); + if (idevicerestore_debug) + debug_plist(message); } } return 0; @@ -659,7 +661,8 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit node = plist_dict_get_item(message, "MsgType"); if (!node || plist_get_node_type(node) != PLIST_STRING) { debug("Unknown message received\n"); - debug_plist(message); + if (idevicerestore_debug) + debug_plist(message); plist_free(message); message = NULL; continue; @@ -689,7 +692,8 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit // at least the "previous error logs" messages usually end up here else { debug("Unknown message type received\n"); - debug_plist(message); + if (idevicerestore_debug) + debug_plist(message); } // finally, if any of these message handlers returned -1 then we encountered |