Tcl Source Code

Artifact [a2793d0eaf]
Login

Artifact a2793d0eaf2c030f19a8fe7e61e5c0776204e4e8:

Attachment "http.tcl.diff" to ticket [559898ffff] added by dchapes 2002-05-24 06:40:56.
Index: http.tcl
===================================================================
RCS file: /cvsroot/tcl/tcl/library/http/http.tcl,v
retrieving revision 1.41
diff -u -r1.41 http.tcl
--- http.tcl	5 Feb 2002 17:08:04 -0000	1.41
+++ http.tcl	23 May 2002 16:36:01 -0000
@@ -242,6 +242,7 @@
 	-timeout 	0
 	-type           application/x-www-form-urlencoded
 	-queryprogress	{}
+	-myaddr		""
 	state		header
 	meta		{}
 	coding		{}
@@ -257,7 +258,7 @@
     set state(charset)	$defaultCharset
     set options {-binary -blocksize -channel -command -handler -headers \
 	    -progress -query -queryblocksize -querychannel -queryprogress\
-	    -validate -timeout -type}
+	    -validate -timeout -type -myaddr}
     set usage [join $options ", "]
     regsub -all -- - $options {} options
     set pat ^-([join $options |])$
@@ -330,14 +331,20 @@
 	set async ""
     }
 
+    if {[string length $state(-myaddr)] > 0} {
+	set myaddr "-myaddr $state(-myaddr)"
+    } else {
+	set myaddr ""
+    }
+
     # If we are using the proxy, we must pass in the full URL that
     # includes the server name.
 
     if {[info exists phost] && [string length $phost]} {
 	set srvurl $url
-	set conStat [catch {eval $defcmd $async {$phost $pport}} s]
+	set conStat [catch {eval $defcmd $async $myaddr {$phost $pport}} s]
     } else {
-	set conStat [catch {eval $defcmd $async {$host $port}} s]
+	set conStat [catch {eval $defcmd $async $myaddr {$host $port}} s]
     }
     if {$conStat} {