From d75b8b9c1b507b1003b4fcfe66f58c104cb893b6 Mon Sep 17 00:00:00 2001 From: ngn Date: Fri, 9 Aug 2024 02:22:49 +0300 Subject: [PATCH] update: more MPTP util debug messages --- locale/tr/LC_MESSAGES/libmp.po | 2 +- src/mptp/util.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/locale/tr/LC_MESSAGES/libmp.po b/locale/tr/LC_MESSAGES/libmp.po index 99ad9e5..3025bb2 100644 --- a/locale/tr/LC_MESSAGES/libmp.po +++ b/locale/tr/LC_MESSAGES/libmp.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-09 01:27+0300\n" +"POT-Creation-Date: 2024-08-09 02:22+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/src/mptp/util.c b/src/mptp/util.c index 6904691..537cf8d 100644 --- a/src/mptp/util.c +++ b/src/mptp/util.c @@ -137,18 +137,24 @@ bool lm_mptp_recvfile(int sock, char *path, lm_mptp_transfer_callback_t callback goto end; while(lm_mptp_client_recv(sock, &packet)){ - if(!lm_mptp_client_verify(&packet)) + if(!lm_mptp_client_verify(&packet)){ + pdebug(__func__, "failed to verify the packet for %s (%lu/%lu)", path, current, total); goto end; + } if(MPTP_FLAGS_CODE(&packet) != MPTP_S2C_COOL){ + pdebug(__func__, "server responded with bad status code for %s (%lu/%lu)", path, current, total); lm_error_set(LM_ERR_RecvBadCode); goto end; } - if(MPTP_IS_LAST(&packet)) + if(MPTP_IS_LAST(&packet)){ + pdebug(__func__, "received the last packet for %s (%lu/%lu)", path, current, total); break; + } if(fwrite(packet.data, 1, packet.header.data_size, file)==0){ + pdebug(__func__, "failed to write received data for %s (%lu/%lu)", path, current, total); lm_error_set(LM_ERR_RecvWriteFail); goto end; }