Prevent application hang if protocol header cannot be read