TclApps Library Source Code
Check-in [35f975c8d8]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

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

Overview
Comment:Make all http requests explictly ipv4 when using 8.6. There is currently a bug in the ipv6 socket handling in 8.6 where if a site has an ipv6 address and does not provide a services on that address then socket -async will return an error to tcl. A synchronous socket will try ipv6 and then ipv4 before returning to tcl. To work around this we can force http requests to use ipv4 until this is fixed so that async sockets operate like the synchronous ones. Signed-off-by: Pat Thoyts <[email protected]>
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 35f975c8d88588dc7ec064fbc1b46a8f58598444
User & Date: patthoyts 2011-05-12 21:25:58
Context
2011-05-16
17:14
Improved aqua support. Drops the ffidl code in favour of using tclgrowl and tkdock for alerts and n Fix some incorrect mouse bindings on this platform. [PT: Refactored this patch to use hooks, adding an alert hook at the same time] Signed-off-by: Kevin Walzer <[email protected]> Signed-off-by: Pat Thoyts <[email protected]> check-in: 925cd04255 user: patthoyts tags: trunk
2011-05-12
21:25
Make all http requests explictly ipv4 when using 8.6. There is currently a bug in the ipv6 socket handling in 8.6 where if a site has an ipv6 address and does not provide a services on that address then socket -async will return an error to tcl. A synchronous socket will try ipv6 and then ipv4 before returning to tcl. To work around this we can force http requests to use ipv4 until this is fixed so that async sockets operate like the synchronous ones. Signed-off-by: Pat Thoyts <[email protected]> check-in: 35f975c8d8 user: patthoyts tags: trunk
2011-03-23
17:31
* tkchat.tcl (::tkchat::parseStr): Render words of 10..40 characters as links to fossil artifact IDs on core.tcl.tk. check-in: c2dfc15db5 user: rmax tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to apps/tkchat/tkchat.tcl.

270
271
272
273
274
275
276


















277
278
279
280
281
282
283
284
285
286
287
288
289
    # NOTE: iocpsock only works well with http 2.5.5 and above (bug #1868845)
    if {![catch {package require Iocpsock}]} {
        if {[package vsatisfies [package provide http] 2.5.5]} {
            ::http::register http 80 ::socket2
        }
    }
}



















namespace eval ::tkchat {
    variable chatWindowTitle "The Tcler's Chat"

    variable HEADUrl {http://tcllib.cvs.sourceforge.net/*checkout*/tcllib/tclapps/apps/tkchat/tkchat.tcl?revision=HEAD}
    variable rcsid   {$Id: tkchat.tcl,v 1.482 2011/03/23 17:31:26 rmax Exp $}

    variable MSGS
    set MSGS(entered) [list \
	    "%user% has entered the chat!" \
	    "Out of a cloud of smoke, %user% appears!" \
	    "%user% saunters in." \
	    "%user% wanders in." \






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
    # NOTE: iocpsock only works well with http 2.5.5 and above (bug #1868845)
    if {![catch {package require Iocpsock}]} {
        if {[package vsatisfies [package provide http] 2.5.5]} {
            ::http::register http 80 ::socket2
        }
    }
}

# There is currently a bug in the ipv6 socket handling in 8.6 where if a
# site has an ipv6 address and does not provide a services on that address
# then socket -async will return an error to tcl. A synchronous socket
# will try ipv6 and then ipv4 before returning to tcl. To work around this
# we can force http requests to use ipv4 until a fix is enabled. We could
# also enable an ipv6 capable tclhttpd at tclers.tk too :)
if {[package vsatisfies [package provide Tcl] 8.6]} {
    proc ::socket_inet4 {args} {
        variable ::tcl::unsupported::socketAF
        set AF [expr {[info exists socketAF] ? $socketAF : ""}]
        set socketAF inet
        set code [catch {uplevel 1 [linsert $args 0 ::socket]} result]
        if {$AF eq {}} { unset socketAF } else { set socketAF $AF }
        return -code $code $result
    }
    ::http::register http 80 ::socket_inet4
}

namespace eval ::tkchat {
    variable chatWindowTitle "The Tcler's Chat"

    variable HEADUrl {http://tcllib.cvs.sourceforge.net/*checkout*/tcllib/tclapps/apps/tkchat/tkchat.tcl?revision=HEAD}
    variable rcsid   {$Id: tkchat.tcl,v 1.483 2011/05/12 21:25:58 patthoyts Exp $}

    variable MSGS
    set MSGS(entered) [list \
	    "%user% has entered the chat!" \
	    "Out of a cloud of smoke, %user% appears!" \
	    "%user% saunters in." \
	    "%user% wanders in." \