Tcl Source Code

Check-in [f3a17a1b81]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:2000-03-19 Sandeep Tamhankar <[email protected]>
* library/http2.1/http.tcl: geturl used to throw an exception when the connection failed; I accidentally returned a token with the error info, breaking backwards compatibility. I changed it back to throwing an exception, but unsetting the state array first (thus still eliminating the original memory leak problem).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | scriptics-sc-2-0-b1
Files: files | file ages | folders
SHA1: f3a17a1b813755855daac429321d18cc36d26e84
User & Date: sandeep 2000-03-19 23:45:38
Context
2000-03-21
22:55
* tests/clock.test: Modified some tests that were not robust with respect to the time zone in which ... check-in: 80bb9d067f user: ericm tags: trunk
2000-03-19
23:45
2000-03-19 Sandeep Tamhankar <[email protected]>
* library/http2.1/http.tcl: geturl used to t...
check-in: f3a17a1b81 user: sandeep tags: trunk, scriptics-sc-2-0-b1
22:32
* library/http2.1/http.tcl: Added -querychannel option and altered some of Brent's modifications t...
check-in: aadf3c36fe user: sandeep tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.









1
2
3
4
5
6
7







2000-03-19  Sandeep Tamhankar <[email protected]>

	* library/http2.1/http.tcl: Added -querychannel option and altered
	some of Brent's modifications to allow asynchronous posts (via
	-command).  Also modified -queryprogress so that it calls the
	query callback as <callback> <token> <total size> <current size>
	to be consistent with -progress.  Added -queryblocksize option
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2000-03-19  Sandeep Tamhankar <[email protected]>

	* library/http2.1/http.tcl: geturl used to throw an exception when
	the connection failed; I accidentally returned a token with the
	error info, breaking backwards compatibility.  I changed it back
	to throwing an exception, but unsetting the state array first
	(thus still eliminating the original memory leak problem).

2000-03-19  Sandeep Tamhankar <[email protected]>

	* library/http2.1/http.tcl: Added -querychannel option and altered
	some of Brent's modifications to allow asynchronous posts (via
	-command).  Also modified -queryprogress so that it calls the
	query callback as <callback> <token> <total size> <current size>
	to be consistent with -progress.  Added -queryblocksize option

Changes to library/http/http.tcl.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
310
311
312
313
314
315
316
317





318
319
320
321
322
323
324
325
326
327
#	the Safesock security policy.  These procedures use a 
#	callback interface to avoid using vwait, which is not 
#	defined in the safe base.
#
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: http.tcl,v 1.23 2000/03/19 22:32:26 sandeep Exp $

package provide http 2.3	;# This uses Tcl namespaces

namespace eval http {
    variable http
    array set http {
	-accept */*
................................................................................
    if {[info exists phost] && [string length $phost]} {
	set srvurl $url
	set conStat [catch {eval $defcmd $async {$phost $pport}} s]
    } else {
	set conStat [catch {eval $defcmd $async {$host $port}} s]
    }
    if {$conStat} {
	# something went wrong, so unset the state array and propagate the





	# error to the caller
	Finish $token $s
	return $token
    }
    set state(sock) $s

    # Wait for the connection to complete

    if {$state(-timeout) > 0} {
	fileevent $s writable [list http::Connect $token]






|







 







|
>
>
>
>
>
|
|
|







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#	the Safesock security policy.  These procedures use a 
#	callback interface to avoid using vwait, which is not 
#	defined in the safe base.
#
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: http.tcl,v 1.24 2000/03/19 23:45:38 sandeep Exp $

package provide http 2.3	;# This uses Tcl namespaces

namespace eval http {
    variable http
    array set http {
	-accept */*
................................................................................
    if {[info exists phost] && [string length $phost]} {
	set srvurl $url
	set conStat [catch {eval $defcmd $async {$phost $pport}} s]
    } else {
	set conStat [catch {eval $defcmd $async {$host $port}} s]
    }
    if {$conStat} {
	# something went wrong while trying to establish the connection
	# The proper response is probably to give the caller a token
	# containing error info, but that would break backwards compatibility.
	# So, let's follow tradition and throw an exception (after unsetting
	# the array).
	unset $token
	error $s
	#Finish $token $s
	#return $token
    }
    set state(sock) $s

    # Wait for the connection to complete

    if {$state(-timeout) > 0} {
	fileevent $s writable [list http::Connect $token]

Changes to library/http2.1/http.tcl.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
310
311
312
313
314
315
316
317





318
319
320
321
322
323
324
325
326
327
#	the Safesock security policy.  These procedures use a 
#	callback interface to avoid using vwait, which is not 
#	defined in the safe base.
#
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: http.tcl,v 1.23 2000/03/19 22:32:26 sandeep Exp $

package provide http 2.3	;# This uses Tcl namespaces

namespace eval http {
    variable http
    array set http {
	-accept */*
................................................................................
    if {[info exists phost] && [string length $phost]} {
	set srvurl $url
	set conStat [catch {eval $defcmd $async {$phost $pport}} s]
    } else {
	set conStat [catch {eval $defcmd $async {$host $port}} s]
    }
    if {$conStat} {
	# something went wrong, so unset the state array and propagate the





	# error to the caller
	Finish $token $s
	return $token
    }
    set state(sock) $s

    # Wait for the connection to complete

    if {$state(-timeout) > 0} {
	fileevent $s writable [list http::Connect $token]






|







 







|
>
>
>
>
>
|
|
|







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#	the Safesock security policy.  These procedures use a 
#	callback interface to avoid using vwait, which is not 
#	defined in the safe base.
#
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: http.tcl,v 1.24 2000/03/19 23:45:38 sandeep Exp $

package provide http 2.3	;# This uses Tcl namespaces

namespace eval http {
    variable http
    array set http {
	-accept */*
................................................................................
    if {[info exists phost] && [string length $phost]} {
	set srvurl $url
	set conStat [catch {eval $defcmd $async {$phost $pport}} s]
    } else {
	set conStat [catch {eval $defcmd $async {$host $port}} s]
    }
    if {$conStat} {
	# something went wrong while trying to establish the connection
	# The proper response is probably to give the caller a token
	# containing error info, but that would break backwards compatibility.
	# So, let's follow tradition and throw an exception (after unsetting
	# the array).
	unset $token
	error $s
	#Finish $token $s
	#return $token
    }
    set state(sock) $s

    # Wait for the connection to complete

    if {$state(-timeout) > 0} {
	fileevent $s writable [list http::Connect $token]

Changes to library/http2.3/http.tcl.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
310
311
312
313
314
315
316
317





318
319
320
321
322
323
324
325
326
327
#	the Safesock security policy.  These procedures use a 
#	callback interface to avoid using vwait, which is not 
#	defined in the safe base.
#
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: http.tcl,v 1.23 2000/03/19 22:32:26 sandeep Exp $

package provide http 2.3	;# This uses Tcl namespaces

namespace eval http {
    variable http
    array set http {
	-accept */*
................................................................................
    if {[info exists phost] && [string length $phost]} {
	set srvurl $url
	set conStat [catch {eval $defcmd $async {$phost $pport}} s]
    } else {
	set conStat [catch {eval $defcmd $async {$host $port}} s]
    }
    if {$conStat} {
	# something went wrong, so unset the state array and propagate the





	# error to the caller
	Finish $token $s
	return $token
    }
    set state(sock) $s

    # Wait for the connection to complete

    if {$state(-timeout) > 0} {
	fileevent $s writable [list http::Connect $token]






|







 







|
>
>
>
>
>
|
|
|







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#	the Safesock security policy.  These procedures use a 
#	callback interface to avoid using vwait, which is not 
#	defined in the safe base.
#
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: http.tcl,v 1.24 2000/03/19 23:45:38 sandeep Exp $

package provide http 2.3	;# This uses Tcl namespaces

namespace eval http {
    variable http
    array set http {
	-accept */*
................................................................................
    if {[info exists phost] && [string length $phost]} {
	set srvurl $url
	set conStat [catch {eval $defcmd $async {$phost $pport}} s]
    } else {
	set conStat [catch {eval $defcmd $async {$host $port}} s]
    }
    if {$conStat} {
	# something went wrong while trying to establish the connection
	# The proper response is probably to give the caller a token
	# containing error info, but that would break backwards compatibility.
	# So, let's follow tradition and throw an exception (after unsetting
	# the array).
	unset $token
	error $s
	#Finish $token $s
	#return $token
    }
    set state(sock) $s

    # Wait for the connection to complete

    if {$state(-timeout) > 0} {
	fileevent $s writable [list http::Connect $token]