def setDownloadRateLimit(infoHash, bytesPerSecond)
      torrentData = @torrentData[infoHash]
      if ! torrentData
        @logger.warn "Asked to set download rate limit for a non-existent torrent #{QuartzTorrent.bytesToHex(infoHash)}"
        return
      end
 
      if bytesPerSecond
        if ! torrentData.downRateLimit
          torrentData.downRateLimit = RateLimit.new(bytesPerSecond, 2*bytesPerSecond, 0)
        else
          torrentData.downRateLimit.unitsPerSecond = bytesPerSecond
        end
      else
        torrentData.downRateLimit = nil
      end

      torrentData.peers.all.each do |peer|
        withPeersIo(peer, "setting download rate limit") do |io|
          io.readRateLimit = torrentData.downRateLimit
        end
      end
     
    end
def setDownloadRateLimit(infoHash, bytesPerSecond)
      torrentData = @torrentData[infoHash]
      if ! torrentData
        @logger.warn "Asked to set download rate limit for a non-existent torrent #{QuartzTorrent.bytesToHex(infoHash)}"
        return
      end
 
      if bytesPerSecond
        if ! torrentData.downRateLimit
          torrentData.downRateLimit = RateLimit.new(bytesPerSecond, 2*bytesPerSecond, 0)
        else
          torrentData.downRateLimit.unitsPerSecond = bytesPerSecond
        end
      else
        torrentData.downRateLimit = nil
      end

      torrentData.peers.all.each do |peer|
        withPeersIo(peer, "setting download rate limit") do |io|
          io.readRateLimit = torrentData.downRateLimit
        end
      end
     
    end
Set the download rate limit. Pass nil as the bytesPerSecond to disable the limit.