Skip to content
Tcl Source Code History Of Ticket 9ee9f4d7be
Login

History Of Ticket 9ee9f4d7be

Artifacts Associated With Ticket 9ee9f4d7be

  1. Ticket change [d26edead12] (rid 183796) by pooryorick on 2020-06-16 15:10:37:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      In the following script, the $tmpchan gains two new characters at the end each
      time a channel is pushed and then popped:
      
      
      <code><pre>
      #! /usr/bin/env tclsh
      
      set data hello
      set tmpchan [file tempfile]
      puts -nonewline $tmpchan $data
      flush $tmpchan
      
      chan configure $tmpchan -translation binary
      set tmpchan2 [file tempfile]
      chan configure $tmpchan2 -translation binary
      for {set i 0} {$i < 10} {incr i} {
          seek $tmpchan 0 end
          set size [chan tell $tmpchan]
          seek $tmpchan 0 start
          set data [read $tmpchan]
          set size2 [string length $data]
          seek $tmpchan 0 start
          zlib push deflate $tmpchan -level 6
          chan truncate $tmpchan2 0
          chan copy $tmpchan $tmpchan2
          chan pop $tmpchan
          puts [list $size $size2]
      }
      close $tmpchan
      
      </pre></code>
      
    5. foundin initialized to: "various"
    6. is_private initialized to: "0"
    7. login: "pooryorick"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Important"
    11. status initialized to: "Open"
    12. submitter initialized to: "pooryorick"
    13. subsystem initialized to: "25. Channel System"
    14. title initialized to: "zlib push/pop corrupts underlying channel"
    15. type initialized to: "Bug"
  2. Ticket change [e6c825012b] (rid 184019) by aku on 2020-06-19 20:00:19:

    1. comment changed to:
      In the following script, the $tmpchan gains two new characters at the end each
      time a channel is pushed and then popped:
      
      
      <code><pre>
      #! /usr/bin/env tclsh
      
      set data hello
      set src [file tempfile]
      puts -nonewline $src $data
      flush $src
      chan configure $src -translation binary
      
      set dst [file tempfile]
      chan configure $dst -translation binary
      
      for {set i 0} {$i < 10} {incr i} {
          # Determine size of src channel
          seek $src 0 end
          set size [chan tell $src]
          seek $src 0 start
      
          # Determine size of content in src channel
          set data [read $src]
          set size2 [string length $data]
          seek $src 0 start
      
          # Copy src over to dst, keep dst empty
          zlib push deflate $src -level 6
          chan truncate $dst 0
          chan copy $src $dst
          chan pop $src
      
          puts [list $size $size2]
      }
      close $src
      close $dst
      
      </pre></code>
      
    2. login: "aku"
    3. mimetype: "text/plain"
  3. Ticket change [b87fa89ec0] (rid 184020) by aku on 2020-06-19 20:03:43:

    1. comment changed to:
      In the following script, the $src gains two new characters at the end each
      time a zlib transform is pushed and then popped:
      
      <code><pre>
      #! /usr/bin/env tclsh
      
      set data hello
      set src [file tempfile]
      puts -nonewline $src $data
      flush $src
      chan configure $src -translation binary
      
      set dst [file tempfile]
      chan configure $dst -translation binary
      
      for {set i 0} {$i < 10} {incr i} {
          # Determine size of src channel
          seek $src 0 end
          set size [chan tell $src]
          seek $src 0 start
          # Determine size of content in src channel
          set data [read $src]
          set size2 [string length $data]
          seek $src 0 start
          # Copy src over to dst, keep dst empty
          zlib push deflate $src -level 6
          chan truncate $dst 0
          chan copy $src $dst
          chan pop $src
          # Show sizes
          puts [list $size $size2]
      }
      close $src
      close $dst
      
      </pre></code>
      
    2. login: "aku"
    3. mimetype: "text/plain"
  4. Ticket change [f246b8bbd2] (rid 184021) by aku on 2020-06-19 20:04:29:

    1. assignee changed to: "dkf"
    2. login: "aku"
    3. mimetype: "text/plain"
  5. Ticket change [5c22080554] (rid 226677) by dkf on 2024-05-25 13:54:01:

    1. icomment:
      This appears to be due to the compression header. For `deflate` that's two bytes. It's rather more for `compress` and `gzip`.
      
      It's quite odd that you're compressing on reading data into Tcl. I wonder if that's related?
      
      (This is now test `zlib-14.1`)
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"
    4. priority changed to: "7 High"
    5. subsystem changed to: "57. zlib"
  6. Ticket change [6e369bebf4] (rid 226744) by dkf on 2024-05-27 09:38:02:

    1. icomment:
      OK, the "problem" is that you're applying a compressor to a channel being read (a case we don't handle) yet the channel is really read-write so the flush on close (or pop) writes the header to it. **Doing `zlib push deflate` creates a channel filter that activates on output.**
      
      I'm not quite sure what to do about this yet.
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"