2011-07-14 22:22:54 +00:00
|
|
|
|
|
|
|
proc chunk {chk} {
|
|
|
|
puts -nonewline [format "%x\r\n" [string length $chk]]
|
|
|
|
puts -nonewline "$chk\r\n"
|
|
|
|
flush stdout
|
|
|
|
}
|
|
|
|
|
2011-07-15 23:20:57 +00:00
|
|
|
proc chunk_pad {{len 256}} {
|
|
|
|
incr len
|
|
|
|
chunk [string range [format "%${len}d" 0] 1 end-1]
|
|
|
|
}
|
|
|
|
|
|
|
|
proc start_chunked {{type "text/html"}} {
|
2013-02-09 22:46:15 +00:00
|
|
|
httpheader $type 0 "Transfer-Encoding: chunked\r\n"
|
2011-07-15 23:20:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc end_chunked {} {
|
|
|
|
puts -nonewline "0\r\n\r\n\r\n"
|
|
|
|
}
|
2011-07-14 22:22:54 +00:00
|
|
|
|