# File lib/thin/connection.rb, line 95
    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

      @response.status, @response.headers, @response.body = *result

      log_error("Rack application returned nil body. " \
                "Probably you wanted it to be an empty string?") if @response.body.nil?

      # HEAD requests should not return a body.
      @response.skip_body! if @request.head?

      # 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 => e
      unexpected_error(e)
      # Close connection since we can't handle response gracefully
      close_connection
    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