Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3c2dee93b16f1769e4da2b166f351bf38c7282cc
Ticket: 219399ffffffffffffffffffffffffffffffffff
Incoming text encoded gzip not being read in binary mode
User & Date: nobody on 2000-10-26 05:12:26
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 6255 Bug
    Version: 8.3
    SubmitDate: '2000-09-12'
    LastModified: '2000-10-25'
    Severity: CRIT
    Status: UnAssn
    Submitter: techsupp
    OS: Solaris
    OSVersion: Solaris 8
    Machine: Ultra 1
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    Name:
    
    George Orwell
    
    
    Extensions:
    
    none
    
    
    CustomShell:
    
    none
    
    
    Comments:
    
    I'm using a fairly recent release:
    
    
            tclsh
    
            % package require http
    
            2.2
    
    
        Incoming gzip is totally failing because <CR>s are turning into <NL>s.
    
    
    ReproducibleScript:
    
    package require http
    
    set headers [list Accept "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*" \
    
        Accept-Encoding gzip  \
    
        Accept-Language en    \
    
        Accept-Charset "iso-8859-1,*,utf-8" ]
    
    
    set token [http::geturl http://www.netaddress.com/  -headers $headers]
    
    upvar #0 $token state
    
    set fd [open temp.body.gz w]
    
    fconfigure $fd -translation binary
    
    puts -nonewline $fd $state(body)
    
    close $fd
    
    
    ObservedBehavior:
    
    Incoming HTTP says text/html encoded gzip.
    
    
    #    HTTP: HTTP/1.1 200 OK
    
    #    HTTP: Date: Mon, 11 Sep 2000 16:07:40 GMT
    
    #    HTTP: Server: Apache/1.2.5
    
    #    HTTP: Content-Length: 2518
    
    #    HTTP: Content-encoding: gzip
    
    #    HTTP: Keep-Alive: timeout=1, max=99
    
    #    HTTP: Connection: Keep-Alive
    
    #    HTTP: Content-Type: text/html
    
    
    In the http package (package require http), there appears
    
    to be an error:
    
    
                if {![regexp -nocase ^text $state(type)]} {
    
                    # Turn off conversions for non-text data
    
                    fconfigure $s -translation binary
    
    
    This is not being triggered, because $state(type) is 'text/html'.
    
    
    DesiredBehavior:
    
    It is not picking up on the text/html being encoded:
    
    
        $state(meta) ...Content-encoding gzip...
    
    
    Patch:
    
    This crude edit means I can now gunzip the data without
    
    failing due to a CRC error:
    
    
        if {![regexp -nocase ^text $state(type)]  \
    
        ||   [regexp -nocase gzip  $state(meta)]} {
    
    
    PatchFiles:
    
    package require http
    
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to:
    Incoming text encoded gzip not being read in binary mode
    
  11. type changed to: "Bug"