Check-in [4ee7aaa953]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove a workaround for a bug in an old version of the http package. And change the "package require" command to make sure a sufficiently new version is loaded.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4ee7aaa953d6cb59905b9ee1bf9f292a7138deb2
User & Date: dan 2011-01-09 05:20:25
Context
2014-12-12
19:52
Updated autoconf and TEA installer check-in: 57f046e114 user: hypnotoad tags: trunk
2011-01-09
05:20
Remove a workaround for a bug in an old version of the http package. And change the "package require" command to make sure a sufficiently new version is loaded. check-in: 4ee7aaa953 user: dan tags: trunk
2008-03-03
10:29
Changes to form submit logic. (CVS 1273) check-in: b992a14631 user: danielk1977 tags: trunk
Changes

Changes to hv/hv3_http.tcl.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
605
606
607
608
609
610
611







612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629

630
631
#     * data://
#     * blank://
#     * https:// (if the "tls" package is available)
#

package require snit
package require Tk
package require http
catch { package require tls }

source [sourcefile hv3_file.tcl]

#
# ::hv3::protocol
#
................................................................................
  }
}

#-----------------------------------------------------------------------
# Work around a bug in http::Finish
#








# First, make sure the http package is actually loaded. Do this by 
# invoking ::http::geturl. The call will fail, since the arguments (none)
# passed to ::http::geturl are invalid.
catch {::http::geturl}

# Declare a wrapper around ::http::Finish
proc ::hv3::HttpFinish {token args} {
  upvar 0 $token state
  catch {
    close $state(sock)
    unset state(sock)
  }
  eval [linsert $args 0 ::http::FinishReal $token]
}

# Install the wrapper.
rename ::http::Finish ::http::FinishReal
rename ::hv3::HttpFinish ::http::Finish

#-----------------------------------------------------------------------








|







 







>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
#     * data://
#     * blank://
#     * https:// (if the "tls" package is available)
#

package require snit
package require Tk
package require http 2.7
catch { package require tls }

source [sourcefile hv3_file.tcl]

#
# ::hv3::protocol
#
................................................................................
  }
}

#-----------------------------------------------------------------------
# Work around a bug in http::Finish
#

# UPDATE: This bug was a leaking file-descriptor. However, it seems to
# have been fixed somewhere around version 2.7. So the [package require]
# at the top of this file has been changed to require at least version
# 2.7 and the workaround code commented out.
#

if 0 {
  # First, make sure the http package is actually loaded. Do this by 
  # invoking ::http::geturl. The call will fail, since the arguments (none)
  # passed to ::http::geturl are invalid.
  catch {::http::geturl}
  
  # Declare a wrapper around ::http::Finish
  proc ::hv3::HttpFinish {token args} {
    upvar 0 $token state
    catch {
      close $state(sock)
      unset state(sock)
    }
    eval [linsert $args 0 ::http::FinishReal $token]
  }
  
  # Install the wrapper.
  rename ::http::Finish ::http::FinishReal
  rename ::hv3::HttpFinish ::http::Finish
}
#-----------------------------------------------------------------------