summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-05-07 18:33:14 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-05-07 18:33:14 (GMT)
commitc97f9936a37d7f2c57b55c930a5dd0d645311dbc (patch)
tree00223e5863f58ce8efac34085aaf849a4bb14c41
parent6dc9a4250e1fef2212a81d3d17f918eb6c8884cf (diff)
downloadblt-c97f9936a37d7f2c57b55c930a5dd0d645311dbc.zip
blt-c97f9936a37d7f2c57b55c930a5dd0d645311dbc.tar.gz
blt-c97f9936a37d7f2c57b55c930a5dd0d645311dbc.tar.bz2
SAMP: removed previous added -keepalive to http::geturl calls except for URL cda.harvard.edu
-rw-r--r--ds9/doc/release/r8.1.html1
-rw-r--r--ds9/library/url.tcl46
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 @@
<li><tt>05.02.2019 CUBE: fix an issue with updating the current slice via the dialog slider.</tt></li>
<li><tt>05.02.2019 REGION: fixed histogram analysis plot if region off image.</tt></li>
<li><tt>05.03.2019 REGION: fixed statistics dialog if region off image.</tt></li>
+<li><tt>05.07.2019 SAMP: removed previous added -keepalive to http::geturl calls except for URL cda.harvard.edu.</tt></li>
<li><tt><b>xx.xx.2019 RELEASE version 8.1b1</b></tt></li>
</ol>
</div>
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