'This is a quick and dirty way of responding to bad requests.
As described by HTTP standard we should be patient and accept the
whole request from the client before sending a polite bad request
response, even in the case when clients send tons of data.
Unlike in the HTTP/1.1 case, this does not actually disconnect the
underlying transport: there\'s no need. This instead just sends a 400
response and terminates the stream.'

def _respondToBadRequestAndDisconnect(self):

    self._conn._respondToBadRequestAndDisconnect(self.streamID)
