From c97f9936a37d7f2c57b55c930a5dd0d645311dbc Mon Sep 17 00:00:00 2001 From: William Joye Date: Tue, 7 May 2019 14:33:14 -0400 Subject: SAMP: removed previous added -keepalive to http::geturl calls except for URL cda.harvard.edu --- ds9/doc/release/r8.1.html | 1 + ds9/library/url.tcl | 46 ++++++++++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/ds9/doc/release/r8.1.html b/ds9/doc/release/r8.1.html index da5a089..b853eb0 100644 --- a/ds9/doc/release/r8.1.html +++ b/ds9/doc/release/r8.1.html @@ -78,6 +78,7 @@
  • 05.02.2019 CUBE: fix an issue with updating the current slice via the dialog slider.
  • 05.02.2019 REGION: fixed histogram analysis plot if region off image.
  • 05.03.2019 REGION: fixed statistics dialog if region off image.
  • +
  • 05.07.2019 SAMP: removed previous added -keepalive to http::geturl calls except for URL cda.harvard.edu.
  • xx.xx.2019 RELEASE version 8.1b1
  • diff --git a/ds9/library/url.tcl b/ds9/library/url.tcl index ac217b6..7ad5c60 100644 --- a/ds9/library/url.tcl +++ b/ds9/library/url.tcl @@ -4,9 +4,8 @@ package provide DS9 1.0 -# get generic file via url +# get file via url # used by Analysis and SAMP - proc GetFileURL {url fname} { upvar $fname fn @@ -40,11 +39,19 @@ proc GetFileFTP {host path fn} { proc GetFileHTTP {url fn} { global ihttp + # this is such a freaking kludge + ParseURL $url foo + if {$foo(authority) == {cda.harvard.edu}} { + set ka 1 + } else { + set ka 0 + } + set ch [open $fn w] if {[catch {http::geturl $url \ -channel $ch \ + -keepalive $ka \ -binary 1 \ - -keepalive 1 \ -timeout $ihttp(timeout) \ -headers "[ProxyHTTP]"} token]} { close $ch @@ -58,27 +65,19 @@ proc GetFileHTTP {url fn} { close $ch if {[info exists token]} { + if {$foo(authority) == {cda.harvard.edu}} { + upvar 0 $token state + http::CloseSocket $state(sock) $token + } + HTTPLog $token http::cleanup $token } } -# Load fits via url +# gets file via url and loads # sync with redirection # used by command line, SAMP, SIA - -proc OpenURLFits {{layer {}} {mode {}}} { - global fitsurl - - set url $fitsurl - if {[EntryDialog [msgcat::mc {URL}] [msgcat::mc {Enter URL}] 80 url]} { - LoadURLFits $url $layer $mode - FinishLoad - - set fitsurl $url - } -} - proc LoadURLFits {url layer mode} { if {[string length $url] == 0} { return @@ -142,7 +141,6 @@ proc LoadURLFitsHTTP {url layer mode} { set token [http::geturl $url \ -channel $ch \ -binary 1 \ - -keepalive 1 \ -timeout $ihttp(timeout) \ -headers "[ProxyHTTP]"] @@ -311,6 +309,18 @@ proc LoadURLFitsHTTP {url layer mode} { } } +proc OpenURLFits {{layer {}} {mode {}}} { + global fitsurl + + set url $fitsurl + if {[EntryDialog [msgcat::mc {URL}] [msgcat::mc {Enter URL}] 80 url]} { + LoadURLFits $url $layer $mode + FinishLoad + + set fitsurl $url + } +} + proc ProcessURLFitsCmd {varname iname} { upvar $varname var upvar $iname i -- cgit v0.12