Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Amazing piece of code…

    Scheduled Pinned Locked Moved Development
    6 Posts 5 Posters 4.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rmssf
      last edited by

      shaper.inc:2796

      
      		if ($data['plr'] && ((!is_numeric($data['plr'])) ||
      			($data['plr'] <= 0 && $data['plr'] > 1))) 
                  		$input_errors[] = "Plr must be an integer between 1 and 100.";
      		if (($data['buckets'] && (!is_numeric($data['buckets']))) ||
      			($data['buckets'] < 1 && $data['buckets'] > 100)) 
                  		$input_errors[] = "Buckets must be an integer between 16 and 65535.";
      
      
      1 Reply Last reply Reply Quote 0
      • E
        eri--
        last edited by

        That's the power of copy/pasto no :)
        I fixed the descriptions.

        1 Reply Last reply Reply Quote 0
        • K
          Klaws
          last edited by

          I vaguely remember that "buckets" is the size of the TBR in bytes, and that the maximum value is 65535.

          Has this been changed?

          1 Reply Last reply Reply Quote 0
          • P
            phil.davis
            last edited by

            Yes, Ermal fixed up the numbers in the tests and the text messages to match each other (I can't remember which were wrong and which were right - but it is in a commit some time ago.)

            As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
            If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

            1 Reply Last reply Reply Quote 0
            • marcellocM
              marcelloc
              last edited by

              Does it will match any time?  
              ($data['plr'] <= 0 && $data['plr'] > 1)
              ($data['buckets'] < 1 && $data['buckets'] > 100)

              How can a value can be smaller then 0 and higher then 1 at the same time? ???

              Treinamentos de Elite: http://sys-squad.com

              Help a community developer! ;D

              1 Reply Last reply Reply Quote 0
              • E
                eri--
                last edited by

                It was wrong mareclloc :)

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.