fix bug that could cause header receive to loop

Signed-off-by: James Paton <jpaton2@gmail.com>