mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 16:40:24 +02:00
25237: TCP function system: make tcp_on_open return status significant
This commit is contained in:
parent
4f9c07dc05
commit
0d7df628a4
3 changed files with 34 additions and 9 deletions
|
|
@ -180,6 +180,29 @@ for sess in $sessnames; do
|
|||
tcp_by_name[$sess]=$fd
|
||||
|
||||
[[ -o zle && -z $nozle ]] && zle -F $fd tcp_fd_handler
|
||||
|
||||
# needed for new completion system, so I'm not too sanguine
|
||||
# about requiring this here...
|
||||
if zmodload -i zsh/parameter; then
|
||||
if (( ${+functions[tcp_on_open]} )); then
|
||||
if ! tcp_on_open $sess $fd; then
|
||||
if [[ -z $quiet ]]; then
|
||||
if (( ${#sessargs} )); then
|
||||
print "Session $sess" \
|
||||
"(host $sessargs[1], port $sessargs[2] fd $fd): tcp_on_open FAILED."
|
||||
else
|
||||
print "Session $sess (fd $fd) tcp_on_open FAILED."
|
||||
fi
|
||||
tcp_close -- $sess
|
||||
else
|
||||
tcp_close -q -- $sess
|
||||
fi
|
||||
stat=1
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z $quiet ]]; then
|
||||
if (( ${#sessargs} )); then
|
||||
print "Session $sess" \
|
||||
|
|
@ -188,14 +211,6 @@ for sess in $sessnames; do
|
|||
print "Session $sess (fd $fd) opened OK."
|
||||
fi
|
||||
fi
|
||||
|
||||
# needed for new completion system, so I'm not too sanguine
|
||||
# about requiring this here...
|
||||
if zmodload -i zsh/parameter; then
|
||||
if (( ${+functions[tcp_on_open]} )); then
|
||||
tcp_on_open $sess $fd
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $TCP_SESS ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue