break up the conn->state switch into conn_read_{...} / conn_write_{...}