fix: TCP network issues
This commit is contained in:
@ -85,6 +85,8 @@ bool lm_mptp_sendfile(int sock, char *path, lm_mptp_transfer_callback_t callback
|
||||
end:
|
||||
if(NULL != file)
|
||||
fclose(file);
|
||||
|
||||
pdebug(__func__, "completed sending %s, sending last packet", path);
|
||||
lm_mptp_server_send(sock, &packet);
|
||||
return ret;
|
||||
}
|
||||
@ -157,7 +159,10 @@ bool lm_mptp_recvfile(int sock, char *path, lm_mptp_transfer_callback_t callback
|
||||
}
|
||||
|
||||
if(current != total){
|
||||
pdebug(__func__, "failed to receive the entire file (left at %lu/%lu): %s (%s)", current, total, path, lm_strerror());
|
||||
if(MPTP_IS_LAST(&packet))
|
||||
pdebug(__func__, "failed to receive the entire file (left at %lu/%lu), got the last packet: %s", current, total, path);
|
||||
else
|
||||
pdebug(__func__, "failed to receive the entire file (left at %lu/%lu): %s (%s)", current, total, path, lm_strerror());
|
||||
lm_error_set(LM_ERR_RecvNotCompleted);
|
||||
goto end;
|
||||
}
|
||||
|
Reference in New Issue
Block a user