# File lib/thin/connection.rb, line 93
    def post_process(result)
      return unless result
      result = result.to_a
      
      # Status code -1 indicates that we're going to respond later (async).
      return if result.first == AsyncResponse.first

      # Set the Content-Length header if possible
      set_content_length(result) if need_content_length?(result)
      
      @response.status, @response.headers, @response.body = *result

      log "!! Rack application returned nil body. Probably you wanted it to be an empty string?" if @response.body.nil?

      # Make the response persistent if requested by the client
      @response.persistent! if @request.persistent?

      # Send the response
      @response.each do |chunk|
        trace { chunk }
        send_data chunk
      end

    rescue Exception
      handle_error
    ensure
      # If the body is being deferred, then terminate afterward.
      if @response.body.respond_to?(:callback) && @response.body.respond_to?(:errback)
        @response.body.callback { terminate_request }
        @response.body.errback  { terminate_request }
      else
        # Don't terminate the response if we're going async.
        terminate_request unless result && result.first == AsyncResponse.first
      end
    end