767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
|
if {[string match text/* $mimetype]} {
set reply [encoding convertto utf-8 [dict get $wapp .reply]]
if {[regexp {\ygzip\y} [wapp-param HTTP_ACCEPT_ENCODING]]} {
catch {
set x [zlib gzip $reply]
set reply $x
puts $chan "Content-Encoding: gzip\r"
fconfigure $chan -translation binary
}
}
} else {
set reply [dict get $wapp .reply]
}
puts $chan "Content-Length: [string length $reply]\r"
puts $chan \r
puts $chan $reply
flush $chan
wappInt-close-channel $chan
}
# This routine runs just prior to request-handler dispatch. The
# default implementation is a no-op, but applications can override
|
<
>
|
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
|
if {[string match text/* $mimetype]} {
set reply [encoding convertto utf-8 [dict get $wapp .reply]]
if {[regexp {\ygzip\y} [wapp-param HTTP_ACCEPT_ENCODING]]} {
catch {
set x [zlib gzip $reply]
set reply $x
puts $chan "Content-Encoding: gzip\r"
}
}
} else {
set reply [dict get $wapp .reply]
}
puts $chan "Content-Length: [string length $reply]\r"
puts $chan \r
fconfigure $chan -translation binary
puts $chan $reply
flush $chan
wappInt-close-channel $chan
}
# This routine runs just prior to request-handler dispatch. The
# default implementation is a no-op, but applications can override
|