@@ -1410,26 +1410,26 @@ sendFile(const char *readfilename, const char *tarfilename, struct stat *statbuf
1410
1410
1411
1411
while ((cnt = fread (buf , 1 , Min (sizeof (buf ), statbuf -> st_size - len ), fp )) > 0 )
1412
1412
{
1413
- if (verify_checksum )
1413
+ /*
1414
+ * The checksums are verified at block level, so we iterate over
1415
+ * the buffer in chunks of BLCKSZ, after making sure that
1416
+ * TAR_SEND_SIZE/buf is divisible by BLCKSZ and we read a multiple
1417
+ * of BLCKSZ bytes.
1418
+ */
1419
+ Assert (TAR_SEND_SIZE % BLCKSZ == 0 );
1420
+
1421
+ if (verify_checksum && (cnt % BLCKSZ != 0 ))
1414
1422
{
1415
- /*
1416
- * The checksums are verified at block level, so we iterate over
1417
- * the buffer in chunks of BLCKSZ, after making sure that
1418
- * TAR_SEND_SIZE/buf is divisible by BLCKSZ and we read a multiple
1419
- * of BLCKSZ bytes.
1420
- */
1421
- Assert ( TAR_SEND_SIZE % BLCKSZ == 0 );
1423
+ ereport ( WARNING ,
1424
+ ( errmsg ( "cannot verify checksum in file \"%s\", block "
1425
+ "%d: read buffer size %d and page size %d "
1426
+ "differ" ,
1427
+ readfilename , blkno , ( int ) cnt , BLCKSZ )));
1428
+ verify_checksum = false;
1429
+ }
1422
1430
1423
- if (cnt % BLCKSZ != 0 )
1424
- {
1425
- ereport (WARNING ,
1426
- (errmsg ("cannot verify checksum in file \"%s\", block "
1427
- "%d: read buffer size %d and page size %d "
1428
- "differ" ,
1429
- readfilename , blkno , (int ) cnt , BLCKSZ )));
1430
- verify_checksum = false;
1431
- continue ;
1432
- }
1431
+ if (verify_checksum )
1432
+ {
1433
1433
for (i = 0 ; i < cnt / BLCKSZ ; i ++ )
1434
1434
{
1435
1435
page = buf + BLCKSZ * i ;
0 commit comments