egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TCL HTTP: can't read "state(after)"

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Fri Dec 14, 2007 8:46 pm    Post subject: Reply with quote

De Kus wrote:
no nice way imho, they could first check if exists state(after) to prevent occurance of unneccessary TCL errors.
Testing this theory it seems to work...

lines 165,166 change to:
Code:
    if {[info exists state(sock)]} { catch {close $state(sock)} }
    if {[info exists state(after)]} { catch {after cancel $state(after)} }

lines 197,198 change to:
Code:
    if {[info exists state(sock)]} { catch {fileevent $state(sock) readable {}} }
    if {[info exists state(sock)]} { catch {fileevent $state(sock) writable {}} }

Using HTTP 2.4.2 and changing the lines above it seems to solve the problem. Running various http queries and a quick .set errrorInfo afterwards yields the following...
Quote:
<speechles> !g google
<sp33chy> 1,460,000,000 Results | Google @ http://www.google.com/ | Google Maps @ http://maps.google.com/ | Google Video @ http://video.google.com/ | Google Groups @ http://groups.google.com/
*meanwhile on the partyline directly after*
<speechles> .set errorInfo
<sp33chy> Currently: couldn't create error file for command: no such file or directory
<sp33chy> Currently: while executing
<sp33chy> Currently: "exec chmod 700 $nb_dir"

<speechles> !w .jasd asd
<sp33chy> Socket Error accessing 'jasd.wikipedia.org' .. Does it exist?
*meanwhile on the partyline directly after*
<speechles> .set errorInfo
<sp33chy> Currently: couldn't open socket: host is unreachable
<sp33chy> Currently: while executing
<sp33chy> Currently: "::http::geturl $query -timeout [expr 1000 * 5]"

Notice the top error message which is usually a state(after) error is instead an error message reporting no error found to report, so this does work as a fix. If someone can shed some light if this is indeed an http package bug it would be wonderful. Wink
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Dec 14, 2007 11:47 pm    Post subject: Reply with quote

I use only one script that grabs data from the web (and causes this annoyance), the OV2 version of B0unTy's iMDB.tcl.

It uses:
Code:
::http::Finish $page

_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber