update: more MPTP util debug messages
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user