Posted to tcl by hypnotoad at Tue Oct 08 21:23:18 GMT 2019view pretty
method DoOutput {} { my variable reply_body chan if {$chan eq {}} return catch { # Causing random issues. Technically a socket is always open for read and write # anyway #my wait writable $chan chan configure $chan -encoding utf-8 -translation {auto crlf} set REPLY [encoding convertto utf-8 $reply_body] ### # Return dynamic content ### set length [string length $REPLY] set result {} if {${length} > 0} { my reply set Content-Length $length append result [my reply output] \n append result $REPLY } else { append result [my reply output] } chan puts -nonewline $chan $result catch {chan flush $chan} my log HttpAccess {} } err }