Fix bug of sending/receiving file with 0 byte.