def set_content_length(self):
        """Compute Content-Length or switch to chunked encoding if possible"""
        try:
            blocks = len(self.result)
        except (TypeError, __HOLE__, NotImplementedError):
            pass
        else:
            if blocks==1:
                self.headers['Content-Length'] = str(self.bytes_sent)
                return
        # XXX Try for chunked encoding if origin server and client is 1.1
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/core/servers/basehttp.py/ServerHandler.set_content_length