turning everything into a nicer state machine
fix for passing garbage to jogma_http_process()