implemented gzip header state machine