How to check a completed gzip file?

c, gzip, linux

Solution

`gunzip -t` checks the compressed file integrity.

Problem

I am writing a function in C that get a .tar.gz data transfer, when I got the data, I should do a check that whether the transfer is complete and the data is valid, so any tips about check the integrity of gzip data? regards

Original source