tcl-hacks

Check-in [13b0a1b7a6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:service should report "End" even for early returns
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:13b0a1b7a66ff60b53a55114464478f1459fd4f5
User & Date: aspect 2018-07-07 17:52:37
Context
2018-07-07
18:01
inet/socks: report errors instead of just early return check-in: 0040d9b146 user: aspect tags: trunk
17:52
service should report "End" even for early returns check-in: 13b0a1b7a6 user: aspect tags: trunk
17:47
fix [read] to handle numChars argument check-in: b93b861890 user: aspect tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to inet/inet.tcl.

114
115
116
117
118
119
120
121
122
123
124
125
126

127

128
129
130
131
132
133
134
        }
    }

    # declare a service
    proc service {name body} {
        set body [format {
            puts "Start [info coroutine]"
            finally [list catch [list close $chan]]
            try {
                %s
            } on error {e o} {
                puts "Error in [info coroutine]: $e"
            }

            puts "End [info coroutine]"

        } $body]
        tailcall proc $name {chan} $body
    }

# HELP is a special method for tcpmux.  It doesn't listen on a port, so /*
    service HELP/* {
        foreach cmd [info commands [namespace current]::*/*] {







<




|
>
|
>







114
115
116
117
118
119
120

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
        }
    }

    # declare a service
    proc service {name body} {
        set body [format {
            puts "Start [info coroutine]"

            try {
                %s
            } on error {e o} {
                puts "Error in [info coroutine]: $e"
            } finally {
                catch {close $chan}
                puts "End [info coroutine]"
            }
        } $body]
        tailcall proc $name {chan} $body
    }

# HELP is a special method for tcpmux.  It doesn't listen on a port, so /*
    service HELP/* {
        foreach cmd [info commands [namespace current]::*/*] {