ftpd::Session method read_handler (public)
<instance of ftpd::Session> read_handler condition
Defined in
- Parameters:
- condition (required)
- Testcases:
-
No testcase defined.
Source code:
set bytes [encoding convertfrom utf-8 [ns_connchan read ${:channel}]]
set rlen [string length $bytes]
set result 0
if {0 && $rlen == 0} {
:log debug "client has closed connection"
} else {
foreach line [split [string trim $bytes] \n] {
set line [string trim $line]
:log debug "${:channel} <<< $line"
if {$line eq ""} continue
if {[regexp {^([A-Za-z]+)\s?(.*)$} $line . cmd arg]} {
set cmd [string toupper $cmd]
if {[:info lookup method $cmd] ne ""} {
:$cmd $arg
set result 1
} else {
:log warning "502 Requested action <$cmd> not taken"
:reply "502 Requested action <$cmd> not taken"
}
} else {
:log warning "line <$line> does not look like a valid command"
}
}
}
return $result
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]