[#83773] [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769 — usa@...
Issue #14108 has been updated by usa (Usaku NAKAMURA).
9 messages
2017/11/15
[#83774] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
usa@garbagecollect.jp wrote:
[#83775] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric
[#83779] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#83781] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric,
[#83782] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[ruby-core:83968] [Ruby trunk Bug#14016][Rejected] URI IPv6 address can't be used to open socket
From:
akr@...
Date:
2017-11-29 09:35:22 UTC
List:
ruby-core #83968
Issue #14016 has been updated by akr (Akira Tanaka).
Status changed from Open to Rejected
Use URI::HTTP.hostname which unwraps the bracket.
```
u = URI("http://[::1]/bar")
p u.hostname #=> "::1"
p u.host #=> "[::1]"
```
----------------------------------------
Bug #14016: URI IPv6 address can't be used to open socket
https://bugs.ruby-lang.org/issues/14016#change-68036
* Author: chucke (Tiago Cardoso)
* Status: Rejected
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.4.2
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
The example occurred when trying to use IPv6 to establish communication between HTTP client and server.
I first created an URI, passed it to Net::HTTP.get, and it blew with the following message:
```
SocketError: Failed to open TCP connection to [::1]:9292 (getaddrinfo: nodename nor servname provided, or not known)
```
It seems to me that the URI and the Socket classes don't play well with its expected representation of an IPv6 address:
```ruby
URI::HTTP.build(host: "[::1]").host #=> "[::1]"
URI::HTTP.build(host: "::1").host #=> ”[::1]”
TCPSocket.new("::1", 9292) #=> #<TCPSocket fd:15>
TCPSocket.new("[::1]", 9292) #=> #<TCPSocket fd:15>
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>