Posted to tcl by apn at Wed Aug 20 14:15:57 GMT 2014view raw

  1. if {
  2. $state(-binary) || ![string match -nocase text* $state(type)]
  3. } {
  4. # Turn off conversions for non-text data
  5. set state(binary) 1
  6. }
  7. if {[info exists state(-channel)]} {
  8. if {$state(binary) || [llength [ContentEncoding $token]]} {
  9. fconfigure $state(-channel) -translation binary
  10. }
  11. if {![info exists state(-handler)]} {
  12. # Initiate a sequence of background fcopies
  13. fileevent $sock readable {}
  14. CopyStart $sock $token
  15. return
  16. }
  17. }
  18.