Artifacts Associated With Ticket 3531209fffffffffffffffffffffffffffffffff
Ticket change [d1d04642f0] (rid 113419) by efrecon on 2012-05-31 22:28:35:
- assignee initialized to: "patthoyts"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The current implementation of the http library does not support URLs that contain raw IPv6 specifications, i.e. http://[2001:5c0:1400:b::d623]/ to take mine as an example. The problem is that the atom of the regexp that should match the host part of the authority is written as [^/:\#?]+ which will not work since IPv6 addresses are written using : as separators (well, not *entirely* true, but almost). Therefore, the parsing stops at improper places within the URL specification and ends up not being able to open the socket against the IP address, even though Tcl 8.6 now has support for IPv6. The following code (extract out of the "parsing" part of the geturl procedure actually performs the work properly: set URLmatcher {(?x) # this is _expanded_ syntax ^ (?: (\w+) : ) ? # <protocol scheme> (?: // ( [^/\#?]+ ) # <location=userinfo + host + port> )? ( / [^\#]*)? # <path> (including query) (?: \# (.*) )? # <fragment> $ } # Phase one: parse, the URL match if {![regexp -- $URLmatcher $url -> proto location srvurl]} { unset $token return -code error "Unsupported URL: $url" } if { [string first "@" $location] >= 0 } { foreach {user hostport} [split $location "@"] break } else { set user "" set hostport $location } set idx [string last ":" $hostport] if { $idx >= 0 } { set port [string trimleft [string range $hostport $idx end] ":"] if { [string is integer $port] } { set host [string trimright [string range $hostport 0 $idx] ":"] } else { set port "" set host $hostport } } else { set port "" set host $hostport } set host [string trim $host "\[\]"] # Phase two: validate This version minimises the regexp parsing and adds a number of string operations. It's not perfect, but at least solve the issue. A regexp guru would be needed to fix this at the regexp level. - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "efrecon"
- subsystem initialized to: "29. http Package"
- title initialized to:
Improper support for IPv6 raw address in http library
- type initialized to: "Bug"
Ticket change [fc977d9164] (rid 108263) by efrecon on 2012-07-06 15:20:08:
- icomment:
I have a copy of the fix above, as part of a copy of the http package, available for more readable code. See: http://code.google.com/p/efr-tools/source/browse/trunk/apps/cxManager/lib/http/http.tcl. I have used the code review facilities available at google code to further highlight the changes that I have made and what needs to be. Once again, this isn't a proper fix from my point of view, needs a regexp expert to fix the URL parsing instead.
- login: "efrecon"
- mimetype: "text/plain"
- username: "efrecon"
- icomment:
Ticket change [ba63711176] (rid 129319) by nijtmans on 2012-07-08 12:13:31:
- assignee changed to: "rmax"
Ticket change [2bba2306c6] (rid 118791) by rmax on 2012-07-08 18:36:48:
- closedate changed to: "2012-07-08T11:36:48"
- closer changed to: "rmax"
- icomment:
allow_comments - 1 Fixed in Check-in [abc8fa71fe].
- login: "rmax"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "rmax"