fload, how to prevent it ?

Forum for Hacking and adding to the php ircbot Wollabot
Post Reply
ardoi

fload, how to prevent it ?

Post by ardoi »

hey,

I used to be able to prevent a bot from foading the network by using the sleep() function. Sins I have updated php this does not seem to work any more. Could also be they changed some thing on quakenet as I took a brake of 3 months on this project.

this is the code I use:

Code: Select all

    while($row = $this->db->fetch_array($r)){

    $this->send_privmsg($data['nick'], $row['text']);
    sleep(1);

    }


It used to wait for 1sec between all messages but now it seems like it just counts all the seconds to gethere and then sends all messages without a delay between them. So it foads the server and get kickt.

How would you prevent flooding ?

Or should I just try to make the info send out by every request smaller ? That would be the easy way out I gues ;)
Giz
Site Admin
Posts: 57
Joined: Wed May 07, 2003 6:19 pm

Post by Giz »

Are you running this as a standalone script via php -q start.php, or running it through an apache module by putting the script in webspace and accessing it from a browser?

You should be using it as a standalone script, but if you're running it through a browser, that might explain the behavior you're seeing if there's output buffering occurring. If you're trying to run through a webserver module, then try to flush() before the sleep() call.

I can't verify that it will fix the problem but it might. Otherwise, the code seems simple enough, and I can't offer much help.
Post Reply