Is it possible to terminate or reset readline() after \r\n\r\n is read?

Is it possible to terminate or reset readline() after "\r\n\r\n" is read?