PDA

View Full Version : Serious Bug? 3.9.1 with events and returning?


tuff
01-04-2003, 03:30 PM
i`m attempting to use the [pre] event with stor to process
a file which is about to be uploaded ie. test.rar

[pre]
stor = c:\ioFTPD\ioSFV\ioSFV.itcl

$args now contains `STOR test.rar` (without the `s)

basically i`m comparing $args to catch the STOR
(if {[string match "STOR" [lindex $args 0]]} {......)

now, if you try and return from this routine you`ll get various problems:

return (will stall the client until you manually abort)
}

break (will stall the client until you manually abort)
}

exit (will kill the ftpd completely, needs restarted)
}

using `return` with various args, ie. 0, 1 etc etc has no effect

this will only happen when ioerror is set to something other than 0 ie.

set ioerror 1

i know i can make this as a standalone script, and it will work
without the need for a `return` at all, but id like to keep all
the processes the sfv checker will use in 1 itcl.

darkone
01-04-2003, 03:33 PM
Sounds like you're setting ioerror to value other than 0.

tuff
01-04-2003, 05:28 PM
with thanks to d1 this problem has been sorted :)

to stop the client from hanging, and return control
you need to pass it:

set ioerror 1
puts "426 Connection closed; transfer aborted."

immediately before you send any other `puts`

FTPServerTools
01-04-2003, 07:31 PM
Great to hear that. I didnt know that as well. It does make complete sense tho.. And the hanging then also makes complete sense..