'Clear out any buffered data that may be hanging around.'

def dataDone(self):

    self.clearLineBuffer()
    if (self.state == 'firstline'):
        return
    if (self.state != 'body'):
        self.reset()
        return
    if (self.length == None):
        self.messageDone()
    elif (self.length < self.bodyReceived):
        self.reset()
    else:
        raise RuntimeError('this    should    never    happen')
