L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2008, 02:08:01 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: send_* runs into infinite loop on too large blobs
Pages: [1]   Go Down
« previous next »
Print
Author Topic: send_* runs into infinite loop on too large blobs  (Read 1369 times)
0 Members and 1 Guest are viewing this topic.
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1077


send_* runs into infinite loop on too large blobs
« on: December 03, 2005, 05:25:18 PM »

When the blobsize gets too large on sending something, bebot produces infinite loops for me - till the bot crashs.

Looks like this then:


Always happens when bebot thinks it needs at least 3 pages.
I think the error is in the cut_size() function in Bot.php - but haven't gotten around to check more exactly yet.
Logged
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
send_* runs into infinite loop on too large blobs
« Reply #1 on: December 04, 2005, 12:32:01 AM »

You're probably using <br> in the blob. You need to modify the cut_size function in bot.php

Code:
function cut_size($msg, $type, $to="", $pri=0)
    {
    preg_match("/^(.*)<a href=\"(.+)\">(.*)$/isU", $msg, $info);
    $info[2] = str_replace("<br>","\n",$info[2]);
    $content = explode("\n", $info[2]);
.... (original code past this point)
Logged

220 Doctor | 220 Adventurer | 220 Shade
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1077


send_* runs into infinite loop on too large blobs
« Reply #2 on: December 04, 2005, 07:51:40 AM »

Thanks, worked like a charm.
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
send_* runs into infinite loop on too large blobs
« Reply #3 on: December 04, 2005, 12:14:54 PM »

Comitted to SVN. Thanx.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Hotshot
Rookie
**
Offline Offline

Posts: 21


Re: send_* runs into infinite loop on too large blobs
« Reply #4 on: September 09, 2006, 07:15:30 AM »

Im having trouble seeing where to put this fix, i see the "cut_size" text in the bot.php but im not sure where i put this fix,
"{
         $this -> cut_size($msg, "tell", $to, $low);
         $send = false;
      }"

thats whats in there at the moment, do i replace it with the new coding or what?

Also how do i get it to work on Guildbot?
« Last Edit: September 09, 2006, 07:28:39 AM by Hotshot » Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: send_* runs into infinite loop on too large blobs
« Reply #5 on: September 09, 2006, 01:11:51 PM »

This fix has been in the bot for almost a year soon, so unless you are running a really really really old version of the bot, it's already in there.

An additional bug in Bot Help was fixed fairly recently.

Regardless, the function cut_size is still in Bot.php, you are just looking at one location where the function is called, not the actual function.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Hotshot
Rookie
**
Offline Offline

Posts: 21


Re: send_* runs into infinite loop on too large blobs
« Reply #6 on: September 10, 2006, 08:30:59 AM »

how come !memberlist doesnt work?
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: send_* runs into infinite loop on too large blobs
« Reply #7 on: September 21, 2006, 09:59:52 AM »

Memberlist is not a part of the core bot, so i can't say.

JJ just pointed out that the fix has somehow managed to be omitted from the 0.2 branch. My apologies for the major oversight.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: send_* runs into infinite loop on too large blobs
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 0
Guests: 21
Total: 21

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.197 seconds with 27 queries. (Pretty URLs adds 0.03s, 4q)
Loading...