Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(852)

Issue 4437053: code review 4437053: net: use C library resolver on FreeBSD, Linux, OS X / a... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by rsc
Modified:
13 years, 11 months ago
Reviewers:
CC:
iant, r, mikio, golang-dev
Visibility:
Public.

Description

net: use C library resolver on FreeBSD, Linux, OS X / amd64, 386 This CL makes it possible to resolve DNS names on OS X without offending the Application-Level Firewall. It also means that cross-compiling from one operating system to another is no longer possible when using package net, because cgo needs to be able to sniff around the local C libraries. We could special-case this one use and check in generated files, but it seems more trouble than it's worth. Cross compiling is dead anyway. It is still possible to use either GOARCH=amd64 or GOARCH=386 on typical Linux and OS X x86 systems. It is also still possible to build GOOS=linux GOARCH=arm on any system, because arm is for now excluded from this change (there is no cgo for arm yet).

Patch Set 1 #

Patch Set 2 : diff -r c1b858bc04cd https://go.googlecode.com/hg #

Patch Set 3 : diff -r 44d9b2c594a8 https://go.googlecode.com/hg/ #

Total comments: 7

Patch Set 4 : diff -r 85760a02b1dd https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+279 lines, -34 lines) Patch
M src/pkg/net/Makefile View 1 2 4 chunks +18 lines, -1 line 0 comments Download
M src/pkg/net/cgo_stub.go View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
A src/pkg/net/cgo_unix.go View 1 2 3 1 chunk +148 lines, -0 lines 0 comments Download
M src/pkg/net/dial.go View 1 4 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/net/dialgoogle_test.go View 1 1 chunk +10 lines, -5 lines 0 comments Download
M src/pkg/net/dnsclient.go View 1 2 3 3 chunks +17 lines, -5 lines 0 comments Download
M src/pkg/net/hosts_test.go View 1 2 3 2 chunks +15 lines, -0 lines 0 comments Download
M src/pkg/net/iprawsock.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/net/ipsock.go View 1 2 3 3 chunks +38 lines, -8 lines 0 comments Download
M src/pkg/net/lookup.go View 1 1 chunk +12 lines, -0 lines 0 comments Download
M src/pkg/net/server_test.go View 1 1 chunk +3 lines, -5 lines 0 comments Download
M src/pkg/net/srv_test.go View 1 1 chunk +5 lines, -1 line 0 comments Download
M src/pkg/net/tcpsock.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/net/udpsock.go View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 7
rsc
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 11 months ago (2011-04-18 23:18:45 UTC) #1
rsc
Changed to R=iant.
13 years, 11 months ago (2011-04-18 23:22:29 UTC) #2
r
LGTM but i am not a competent reviewer. perhaps the package docs for net should ...
13 years, 11 months ago (2011-04-18 23:27:29 UTC) #3
iant
LGTM http://codereview.appspot.com/4437053/diff/5001/src/pkg/net/cgo_unix.go File src/pkg/net/cgo_unix.go (right): http://codereview.appspot.com/4437053/diff/5001/src/pkg/net/cgo_unix.go#newcode99 src/pkg/net/cgo_unix.go:99: str = C.GoString(C.gai_strerror(gerrno)) If you really want to ...
13 years, 11 months ago (2011-04-19 04:55:15 UTC) #4
mikio
Looks good to me, thanks! http://codereview.appspot.com/4437053/diff/5001/src/pkg/net/cgo_unix.go File src/pkg/net/cgo_unix.go (right): http://codereview.appspot.com/4437053/diff/5001/src/pkg/net/cgo_unix.go#newcode63 src/pkg/net/cgo_unix.go:63: default: Should we check ...
13 years, 11 months ago (2011-04-19 05:03:56 UTC) #5
rsc
I made all the suggested changes except renaming firstSupportedAddr. LookupHost returns addrs []string after all.
13 years, 11 months ago (2011-04-20 19:21:50 UTC) #6
rsc
13 years, 11 months ago (2011-04-20 19:22:03 UTC) #7
*** Submitted as http://code.google.com/p/go/source/detail?r=cc0f39d02e93 ***

net: use C library resolver on FreeBSD, Linux, OS X / amd64, 386

This CL makes it possible to resolve DNS names on OS X
without offending the Application-Level Firewall.

It also means that cross-compiling from one operating
system to another is no longer possible when using
package net, because cgo needs to be able to sniff around
the local C libraries.  We could special-case this one use
and check in generated files, but it seems more trouble
than it's worth.  Cross compiling is dead anyway.

It is still possible to use either GOARCH=amd64 or GOARCH=386
on typical Linux and OS X x86 systems.

It is also still possible to build GOOS=linux GOARCH=arm on
any system, because arm is for now excluded from this change
(there is no cgo for arm yet).

R=iant, r, mikioh
CC=golang-dev
http://codereview.appspot.com/4437053
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b