validate received bytes and expected file size
parent
db94ee6ef8
commit
cc67335f13
|
@ -616,6 +616,12 @@ err:
|
||||||
gettimeofday(&tv_stop, NULL);
|
gettimeofday(&tv_stop, NULL);
|
||||||
timersub(&tv_stop, &tv_start, &tv);
|
timersub(&tv_stop, &tv_start, &tv);
|
||||||
|
|
||||||
|
if (data_len != file_size) {
|
||||||
|
syslog(LOG_ERR, "Failure, file size is %lu bytes but received %lu bytes!\n",
|
||||||
|
file_size, data_len);
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
if (_cli.state == TIP_CLIENT_DONE) {
|
if (_cli.state == TIP_CLIENT_DONE) {
|
||||||
printf("OK.\n");
|
printf("OK.\n");
|
||||||
syslog(LOG_INFO, "Done in %lu.%06lu seconds (%lu Mbytes/second). "
|
syslog(LOG_INFO, "Done in %lu.%06lu seconds (%lu Mbytes/second). "
|
||||||
|
|
Loading…
Reference in New Issue