example:
Code: Select all
proc dccaccept {idx data} {
# blah blah
set idx [connect $ip $port]
control $idx myuser
}
proc myuser {idx data} {
global theusername
if {$data == ""} { putlog "$idx closed connection" }
if {[validuser $data]} {
set username $data
control $idx mypassword
}
}
proc mypassword {idx data} {
global theusername
if {$data == ""} { putlog "$idx closed connection" }
if {[passwdok $theusername $data]} {
control $idx myrealinterface
}
}
proc myrealinterface {idx data} {
if {$data == ""} { putlog "$idx closed connection" }
# blah blah
}
Why is it that when I close the connection, I see the putlog three times? if I put a number with each different putlog, I see each different putlog. If there is an error in myrealinterface, instead of the connection terminating I get kicked back to the password proc. Basically, if the connection gets closed in myrealinterface, it gets kicked back to the previous control procedure. This is not what I want
I have tried 'control $idx ""' and 'control $idx' but that means that it just seems to try and call the idx number as a proc (calling '<idx> <data>' instead of '<proc> <idx> <data>'
This is very strange. It would be useful if someone could explain this or tell me how I can perhaps 'clear' the procs behind it. I have tried looking through some of the tcldcc.c and some of the other source, but to no avail
Thanks for your time, and thanks in advance.