update: more MPTP util debug messages

This commit is contained in:
ngn 2024-08-09 02:22:49 +03:00
parent bee0073e58
commit d75b8b9c1b
2 changed files with 9 additions and 3 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -137,18 +137,24 @@ bool lm_mptp_recvfile(int sock, char *path, lm_mptp_transfer_callback_t callback
goto end; goto end;
while(lm_mptp_client_recv(sock, &packet)){ 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; goto end;
}
if(MPTP_FLAGS_CODE(&packet) != MPTP_S2C_COOL){ 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); lm_error_set(LM_ERR_RecvBadCode);
goto end; 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; break;
}
if(fwrite(packet.data, 1, packet.header.data_size, file)==0){ 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); lm_error_set(LM_ERR_RecvWriteFail);
goto end; goto end;
} }