Copy _parse() from Twisted trunk (to be removed after switch to endpoints)