1
0
mirror of https://github.com/golang/go synced 2024-10-03 07:21:21 -06:00
Commit Graph

36 Commits

Author SHA1 Message Date
Mikio Hara
92c8df46c6 src: make use of runtime.GOOS, GOARCH instead of syscall.OS, ARCH
R=rsc, r
CC=golang-dev
https://golang.org/cl/5545048
2012-01-14 06:40:55 +09:00
Russ Cox
965845a86d all: sort imports
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072
2011-11-02 15:54:16 -04:00
Russ Cox
eb6929299b src/pkg/[n-z]*: gofix -r error -force=error
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
2011-11-01 22:05:34 -04:00
Joel Sing
d130611f45 net: disable "tcp" test on openbsd
Doing a socket/listen on an unspecified address with an unspecified
address family is likely to result in an AF_INET6 socket on an IPv6
capable system, which under OpenBSD means IPv6 only - not IPv4 *and*
IPv6. In this case trying to connect to this socket from an IPv4
loopback address is not going to end well.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4807057
2011-08-26 15:38:02 -04:00
Fazlul Shahriar
0f7bc92bdb net: Plan 9 support
All tests enabled by default passes except those in timeout_test.go.

For TestLookupPort, add an entry for "bootps" in /lib/ndb/common
(Plan 9 calls it "bootp"). I've sent out a patch to fix this.

R=paulzhol, rsc, mikioh.mikioh
CC=ality, golang-dev
https://golang.org/cl/4779041
2011-08-17 13:28:29 -04:00
Russ Cox
4706ce309f net: stop Mac popups
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4559059
2011-05-31 16:15:23 -04:00
Mikio Hara
8c6dc5fea5 net: re-enable wildcard listening
Fixes #1854.

R=bradfitz, golang-dev
CC=golang-dev
https://golang.org/cl/4550062
2011-05-22 09:48:04 -07:00
Mikio Hara
2ddcad96d7 net: protocol family adaptive address family selection
This CL will help to make an adaptive address family
selection possible when an any address family, vague
network string such as "ip", "tcp" or "udp" is passed
to Dial and Listen API.

Fixes #1769.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4438066
2011-05-16 17:03:06 -04:00
Russ Cox
c9164a5d77 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
https://golang.org/cl/4437053
2011-04-20 15:21:59 -04:00
Russ Cox
41f93a430f net: drop laddr from Dial, cname from LookupHost; new functions
Drop laddr argument from Dial.

Drop cname return from LookupHost.

Add LookupIP, LookupCNAME, ParseCIDR, IP.Equal.
Export SplitHostPort, JoinHostPort.
Add AAAA (IPv6) support to host lookups.

Preparations for implementing some of the
lookups using cgo.

ParseCIDR and IP.Equal are logically new in this CL
but accidentally snuck into an earlier CL about unused
labels that was in the same client.

In crypto/tls, drop laddr from Dial to match net.

R=golang-dev, dsymonds, adg, rh
CC=golang-dev
https://golang.org/cl/4244055
2011-03-28 23:28:42 -04:00
Russ Cox
f4e76d8309 replace non-blocking send, receive syntax with select
R=golang-dev, nigeltao, niemeyer, r
CC=golang-dev
https://golang.org/cl/4079053
2011-01-31 18:36:28 -05:00
Russ Cox
f626696d21 net: fix build on old Linux kernels
Thanks to Mike Beller for identifying the problem.

Fixes #1442.

R=bradfitz, bradfitzgo
CC=golang-dev
https://golang.org/cl/4102042
2011-01-26 15:46:15 -05:00
Russ Cox
035fcb0da2 net: fix build on freebsd
TBR=adg
CC=golang-dev
https://golang.org/cl/3992044
2011-01-19 15:24:25 -05:00
Albert Strasheim
01fad6a6b0 net: add unixpacket
R=golang-dev, rsc, rsc1
CC=golang-dev
https://golang.org/cl/2309043
2011-01-19 14:21:58 -05:00
Alex Brainman
e3a0c2f6cf net: disable tests for functions not available on windows
R=r, Joe Poirier, rsc
CC=golang-dev
https://golang.org/cl/2123044
2010-09-12 12:02:29 +10:00
Russ Cox
bb84f4b5d2 changes &x -> x[0:] for array to slice conversion
R=gri
CC=golang-dev
https://golang.org/cl/1326042
2010-05-27 14:51:47 -07:00
Russ Cox
47a0533411 net: introduce net.Error interface
Adds two more methods, Timeout and Temporary.
Implemented by os.Errno too.  The intent is to make
the checks for os.EAGAIN a little less clunky.
It should also let us clean up a bug that Mike Solomon
pointed out: if a network server gets an "out of file descriptors"
error from Accept, the listener should not stop.
It will be able to check this because that error would
have Temporary() == true.

Also clean up some underscore names.

Fixes #442.

R=r
CC=golang-dev, msolo
https://golang.org/cl/957045
2010-04-26 22:15:25 -07:00
Russ Cox
9750adbbad strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports

R=r
CC=golang-dev
https://golang.org/cl/224062
2010-02-25 16:01:29 -08:00
Russ Cox
5c2197ac8f net: disable UDP server test
has been flaking on various architectures.
not sure why, but doesn't seem to be Go's fault.

Fixes #617.

R=r
CC=golang-dev
https://golang.org/cl/217093
2010-02-22 20:38:56 -08:00
Robert Griesemer
a3d1045fb7 1) Change default gofmt default settings for
parsing and printing to new syntax.

   Use -oldparser to parse the old syntax,
   use -oldprinter to print the old syntax.

2) Change default gofmt formatting settings
   to use tabs for indentation only and to use
   spaces for alignment. This will make the code
   alignment insensitive to an editor's tabwidth.

   Use -spaces=false to use tabs for alignment.

3) Manually changed src/exp/parser/parser_test.go
   so that it doesn't try to parse the parser's
   source files using the old syntax (they have
   new syntax now).

4) gofmt -w src misc test/bench

3rd set of files.

R=rsc
CC=golang-dev
https://golang.org/cl/180048
2009-12-15 15:35:38 -08:00
Russ Cox
2807621d01 net: more fiddling with the udp test.
i don't know why the timeout needs
  to be so big.

R=r
https://golang.org/cl/165063
2009-12-04 18:34:45 -08:00
Russ Cox
3b858fb808 net: turn off empty packet test by default
Fixes #374.

R=r
https://golang.org/cl/166053
2009-12-03 22:19:55 -08:00
Russ Cox
e89441ba8f net: test and fix support for 0-length datagram packets.
Fixes #274.

R=r
CC=jonathan.r.hudson
https://golang.org/cl/163072
2009-12-02 15:17:49 -08:00
Russ Cox
9ac4449cb2 gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkg
R=r, gri
CC=golang-dev
https://golang.org/cl/156115
2009-11-20 11:45:05 -08:00
Russ Cox
6e788e0f0f net: enforce timeouts for ReadFrom/WriteTo
Fixes #153.

R=r
https://golang.org/cl/154177
2009-11-17 08:39:17 -08:00
Russ Cox
e23f75b3c4 net: disable more ipv6 tests
R=agl, agl1
CC=golang-dev
https://golang.org/cl/153050
2009-11-10 18:00:27 -08:00
Robert Griesemer
3bb0032cd6 - replaced gofmt expression formatting algorithm with
rsc's algorithm
- applied gofmt -w misc src
- partial CL (last chunk)

R=rsc, r
http://go/go-review/1024041
2009-11-09 21:23:52 -08:00
Robert Griesemer
40621d5c0d remove semis after statements in one-statement statement lists
R=rsc, r
http://go/go-review/1025029
2009-11-09 12:07:39 -08:00
Robert Griesemer
5d37705416 gofmt-ify net
R=rsc
http://go/go-review/1017045
2009-11-04 23:16:46 -08:00
Russ Cox
c83b838641 package net cleanup
added ReadFrom/WriteTo for packet protocols like UDP.
simplified the net.Conn interface.
added new net.PacketConn interface for packet protocols.
implemented proper UDP listener.

cleaned up LocalAddr/RemoteAddr methods - cache in netFD.

threw away various unused methods.

an interface change:
introduced net.Addr as a network address interface,
to avoid conversion of UDP host:port to string and
back for every ReadFrom/WriteTo sequence.

another interface change:
since signature of Listener.Accept was changing anyway,
dropped the middle return value, because it is available
as c.RemoteAddr().  (the Accept signature predates the
existence of that method.)

Dial and Listen still accept strings, but the proto-specific
versions DialTCP, ListenUDP, etc. take net.Addr instead.

because the generic Dial didn't change and because
no one calls Accept directly (only indirectly via the http
server), very little code will be affected by these interface
changes.

design comments welcome.

R=p
CC=go-dev, r
http://go/go-review/1018017
2009-11-02 18:37:30 -08:00
Russ Cox
20011bc878 unused imports
R=r
OCL=34731
CL=34731
2009-09-17 10:27:04 -07:00
Russ Cox
ca6a0fee1b more "declared and not used".
the last round omitted := range and only
checked 1 out of N vars in a multi-var :=

R=r
OCL=34624
CL=34638
2009-09-15 09:41:59 -07:00
Russ Cox
b04ac108fd convert non-low-level non-google pkg code
to whole-package compilation.

R=r
OCL=33070
CL=33101
2009-08-12 13:19:17 -07:00
Russ Cox
d3a412a5ab io.StringBytes -> strings.Bytes
io.ByteBuffer -> bytes.Buffer

left io.ByteBuffer stub around for now,
for protocol compiler.

R=r
OCL=30861
CL=30872
2009-06-29 15:24:23 -07:00
Russ Cox
5d2ee9d90a add Addr() string to net.Listener interface.
use it to avoid use of fixed ports in tests.
convert google/net/rpc to gotest

R=r
DELTA=523  (275 added, 229 deleted, 19 changed)
OCL=30458
CL=30460
2009-06-17 21:44:26 -07:00
Rob Pike
d90e7cbac6 mv src/lib to src/pkg
tests: all.bash passes, gobuild still works, godoc still works.

R=rsc
OCL=30096
CL=30102
2009-06-09 09:53:44 -07:00