'We only override this to use \'deferring_http_request\' class
instead of the normal http_request class; it sucks to need to override
this'

def found_terminator(self):

    if self.current_request:
        self.current_request.found_terminator()
    else:
        header = self.in_buffer
        self.in_buffer = ''
        lines = header.split('\r\n')
        while (lines and (not lines[0])):
            lines = lines[1:]
        if (not lines):
            self.close_when_done()
            return
        request = lines[0]
        (command, uri, version) = http_server.crack_request(request)
        header = http_server.join_headers(lines[1:])
        (rpath, rquery) = http_server.splitquery(uri)
        if ('%' in rpath):
            if rquery:
                uri = ((http_server.unquote(rpath) + '?') + rquery)
            else:
                uri = http_server.unquote(rpath)
        r = deferring_http_request(self, request, command, uri, version, header)
        self.request_counter.increment()
        self.server.total_requests.increment()
        if (command is None):
            self.log_info(('Bad    HTTP    request:    %s' % repr(request)), 'error')
            r.error(400)
            return
        for h in self.server.handlers:
            if h.match(r):
                try:
                    self.current_request = r
                    h.handle_request(r)
                except:
                    self.server.exceptions.increment()
                    ((file, fun, line), t, v, tbinfo) = asyncore.compact_traceback()
                    self.server.log_info(('Server    Error:    %s,    %s:    file:    %s    line:    %s' % (t, v, file, line)), 'error')
                    try:
                        r.error(500)
                    except:
                        pass
                return
        r.error(404)
