# File rddc_update.rb, line 24
  def update
    #connecting to dyndns
    if @updated == nil then

      Net::HTTP.start(@main_options.get_option("update_server")) { |http|
        update_string = String.new

        #fixxme
        @wanted_update.get_hash.each_key { |key|
          if @valid_update.get_hash.has_key? key
            update_string = update_string + "&" + key + "=" + @wanted_update.get_option(key)
          end
        }

        update_string = update_string + "&" +  @main_options.get_option("update_option_ip") + "=" +  @ip.ip

        #if auth == url add username and password string to update_string
        if @main_options.get_option("auth") == "url" then
          update_string = update_string + "&username=" + @conf.get_option("username") + "&password=" + @conf.get_option("password")
        end

        req = Net::HTTP::Get.new(@main_options.get_option("update_url") + update_string, {'User-Agent' => 'rddc-0.1'})          

        #if auth == base64 add base64 encoded authentication to http request
        if @main_options.get_option("auth") == "base64" then
          req.basic_auth @conf.get_option("username"), @conf.get_option("password")
        end
        response = http.request(req)
        @updated = response.body
      }
    end
    return @updated
  end