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
e46e192857
net: fix build
...
R=adg
CC=golang-dev
https://golang.org/cl/3982051
2011-01-26 12:38:06 -05:00
Russ Cox
e7183e7518
net: return cname in LookupHost
...
Fixes #1395 .
R=adg
CC=golang-dev
https://golang.org/cl/4036044
2011-01-24 14:12:43 -05:00
Ian Lance Taylor
9e441e5215
net: Fix race condition in test.
...
The test code used to do this:
for _, tc := range tests {
ch <- &tc
}
Note that &tc is always the same value here. As the value is
received from the channel, the sender can loop around and
change the contents of tc. This means that the receiver's
value is unstable and can change while it is in use.
R=adg, r2, rsc
CC=chris, golang-dev
https://golang.org/cl/3978043
2011-01-21 13:57:52 -08:00
Alex Brainman
de2184f3a8
net: get tests working to fix windows build
...
R=golang-dev
CC=golang-dev
https://golang.org/cl/4089041
2011-01-20 19:18:04 +11:00
Russ Cox
b7bf2a3a0b
net: fix windows build (?)
...
TBR=adg
CC=golang-dev
https://golang.org/cl/4083042
2011-01-20 00:16:16 -05:00
Andrew Gerrand
5eb8c9baa7
net: remove duplicate import of runtime
...
R=rsc
CC=golang-dev
https://golang.org/cl/3999046
2011-01-20 12:56:32 +11: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
Kyle Lemons
a4f6ed3574
net: add LookupAddr
...
R=adg, rsc
CC=golang-dev
https://golang.org/cl/3851041
2011-01-19 15:11:03 -05:00
Wei Guangjing
ff25900bb6
net: implement windows timeout
...
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/1731047
2011-01-19 14:49:25 -05:00
Albert Strasheim
3a97119517
net, syscall: return source address in Recvmsg
...
R=rsc
CC=golang-dev
https://golang.org/cl/3766042
2011-01-19 14:34:53 -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
Corey Thomasson
43582bad33
net: avoid nil dereference if /etc/services can't be opened
...
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4081041
2011-01-19 09:55:46 -05:00
Alex Brainman
3a052b5f54
net: use closesocket api instead of CloseHandle on Windows
...
thanks to piotrnar for the original CL.
Fixes #1371 .
R=rsc
CC=golang-dev
https://golang.org/cl/3834042
2011-01-12 15:55:17 +11:00
Michael Hoisie
ed1cbca81f
net: fix close of Listener
...
Fixes #1375 .
R=rsc, r
CC=golang-dev
https://golang.org/cl/3731048
2011-01-04 11:55:13 -05:00
Russ Cox
0c54225b51
remove nacl
...
The recent linker changes broke NaCl support
a month ago, and there are no known users of it.
The NaCl code can always be recovered from the
repository history.
R=adg, r
CC=golang-dev
https://golang.org/cl/3671042
2010-12-15 11:49:23 -05:00
Mikio Hara
7ec69c179d
gofmt -s -w src
...
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/3592041
2010-12-11 13:49:45 -08:00
Albert Strasheim
cf6c212197
syscall, net: Add Recvmsg and Sendmsg on Linux.
...
Working on issue 1101.
R=rsc
CC=golang-dev
https://golang.org/cl/2331044
2010-12-07 13:40:14 -05:00
Russ Cox
92bfd850e0
net: fix TestDialGoogle
...
TBR=r
CC=golang-dev
https://golang.org/cl/3417042
2010-12-06 14:07:36 -08:00
Kyle Consalus
009aebdba8
Removed bytes.Add and bytes.AddByte; we now have 'append'.
...
Changed all uses of bytes.Add (aside from those testing bytes.Add) to append(a, b...).
Also ran "gofmt -s" and made use of copy([]byte, string) in the fasta benchmark.
R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/3302042
2010-12-01 11:59:13 -08:00
Wei Guangjing
95c341fc78
net: add ReadFrom and WriteTo windows version.
...
Fixes #1275 .
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/3136042
2010-11-22 11:01:30 -05:00
Wei Guangjing
11ace8e975
net: fix windows build
...
R=rsc
CC=golang-dev
https://golang.org/cl/2932041
2010-11-05 23:08:18 -04:00
Keith Rarick
a144e3ec36
net: provide public access to file descriptors
...
Fixes #918 .
R=rsc, rog, brainman
CC=golang-dev
https://golang.org/cl/2904041
2010-11-05 14:02:03 -04:00
Chris Jones
25b1e83262
net: fix LookupSRV
...
R=rsc, chris
CC=golang-dev
https://golang.org/cl/2420041
2010-11-04 10:30:39 -04:00
Russ Cox
69c4e9380b
use append
...
R=gri, r, r2
CC=golang-dev
https://golang.org/cl/2743042
2010-10-27 19:47:23 -07:00
Russ Cox
d86ab015f7
use copy
...
R=gri
CC=golang-dev
https://golang.org/cl/2763041
2010-10-26 21:52:54 -07:00
Robert Griesemer
3478891d12
gofmt -s -w src misc
...
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
David Symonds
4f6fb1b775
net: fix comment on Dial to mention unix/unixgram.
...
R=rsc
CC=golang-dev
https://golang.org/cl/2639041
2010-10-21 08:17:24 -04:00
Russ Cox
2408a4bbbd
net: allow _ in names
...
Enables lookup of _jabber._tcp.gmail.com's SRV record.
Fixes #1167 .
R=r, r2
CC=golang-dev
https://golang.org/cl/2353043
2010-10-07 06:45:50 -04:00
Russ Cox
a0a7768b21
net: comment pedantry
...
Fixes #1167 .
R=r, r2
CC=golang-dev
https://golang.org/cl/2290044
2010-10-06 11:54:53 -04:00
Mikio Hara
4e3c58cd62
net: fix comment
...
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2358041
2010-10-06 21:47:25 +11:00
Russ Cox
d47266558d
net: enable v4-over-v6 on ip sockets
...
Not all OS make that the default.
Can finally do this now that the syscall package
has the right definitions.
Fixes #679 .
R=r
CC=golang-dev
https://golang.org/cl/2204048
2010-09-24 16:52:06 -04:00
Russ Cox
b031b5cfde
net: fix crash in DialIP
...
Reported by jan.newmarch.
Fixes #1130 .
R=r
CC=golang-dev
https://golang.org/cl/2212043
2010-09-24 16:50:50 -04:00
Russ Cox
2ee420fa5e
... changes
...
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/2273042
2010-09-24 11:55:48 -04:00
Fazlul Shahriar
dd0dec6290
net/dict: parse response correctly + typo
...
* SHOW DB responds with a
"110 n databases present - text follows" -- parse it.
* Doing a Define() on a non-existing word gives error
"invalid definition count: no", when we really
want "552 no match".
R=rsc
CC=golang-dev
https://golang.org/cl/2211041
2010-09-16 13:37:35 -04:00
Russ Cox
be443ee8bc
5g: register allocation bugs
...
Fixes #1099 .
R=ken2, r
CC=golang-dev
https://golang.org/cl/2147047
2010-09-12 00:06:45 -04: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
Rob Pike
0aa2317096
arm: work around reg allocator bug in 5g, in two parts.
...
1) hack regalloc to leave R9 (m) and R10 (g) alone.
the real fix is tricker, but this gets us running
2) fix up the few places in the package sources that
the shortage of registers affects, by simplifying
some expressions.
all of this should be reverted when the right fix is in.
Fixes #1084 .
R=rsc
CC=golang-dev
https://golang.org/cl/2132046
2010-09-10 20:55:29 -07:00
Russ Cox
0f5830b9c3
net: fix windows build
...
R=adg
CC=golang-dev
https://golang.org/cl/2111045
2010-09-10 15:50:29 -04:00
Russ Cox
9c1b6dffd6
net: fix freebsd build
...
R=adg
CC=golang-dev
https://golang.org/cl/2174043
2010-09-10 14:40:56 -04:00
Corey Thomasson
ec72f9bf18
net: add LookupMX
...
R=rsc
CC=golang-dev
https://golang.org/cl/1976049
2010-08-26 13:32:45 -04:00
Evan Shaw
33cb46903e
net/textproto: Handle multi-line responses
...
This is required for FTP and SMTP; maybe others.
R=rsc
CC=golang-dev
https://golang.org/cl/1892052
2010-08-26 13:32:23 -04:00
Scott Lawrence
d125faeed0
net/ipsock.go: fix error checking bug
...
Check oserr, not err for non-nil (err is never changed)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1965042
2010-08-22 22:12:56 +10:00
Russ Cox
da392d9136
build: no required environment variables
...
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Mikio Hara
e41987c821
net: make IPv6 String method standards compliant
...
draft-ietf-6man-text-addr-representation-07 will introduce
a canonical textual representation format for IPv6 address.
R=rsc
CC=golang-dev
https://golang.org/cl/1856047
2010-08-12 00:03:01 -07:00
Russ Cox
844a86317d
net/textproto: new package, with example net/dict
...
Generic text-based network protcol library for SMTP-like protocols.
HTTP and NNTP should be changed to use this package,
and I expect that SMTP and POP3 will be able to use it too.
R=cemeyer, nigeltao_golang, r
CC=golang-dev, petar-m
https://golang.org/cl/889041
2010-08-06 17:37:45 -07:00
Alex Brainman
e96b6835a9
fix windows build
...
R=rsc
CC=golang-dev
https://golang.org/cl/1890045
2010-08-06 09:42:55 +10:00
Rob Pike
c78be462a0
once: replace all uses of package once with sync.Once.
...
package once remains for now; will be deleted after next release.
R=golang-dev, brainman
CC=golang-dev
https://golang.org/cl/1914046
2010-08-06 06:14:41 +10:00
Wei Guangjing
adc13b1e48
net: implement windows version of LookupHost/Port/SRV
...
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/1748042
2010-07-29 14:58:28 +10:00
Andrew Gerrand
fc4ba1546c
net: add nil checks to several String methods to avoid panics
...
Fixes #945 .
R=r
CC=golang-dev
https://golang.org/cl/1848049
2010-07-27 17:22:22 +10:00
Russ Cox
5ee02eef4c
net: TCPConn.SetNoDelay, back by popular demand
...
R=r
CC=golang-dev
https://golang.org/cl/1880047
2010-07-26 16:19:39 -07:00
Alex Brainman
4d87e8ab08
net: fix crashing Read/Write when passed empty slice on windows
...
Fixes #921 .
R=rsc
CC=golang-dev
https://golang.org/cl/1862043
2010-07-26 12:50:03 +10:00
Alex Brainman
42dd7a6dae
net(windows): properly handle EOF in (*netFD).Read().
...
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1848045
2010-07-20 23:51:07 -07:00
Vinu Rajashekhar
a9a24d4d8a
Corrected a print statement from printing netfd to fd.
...
R=iant
CC=golang-dev
https://golang.org/cl/1805041
2010-07-10 14:40:48 -07:00
Alex Brainman
bb9261bf3b
net: initial attempt to implement windows version
...
R=rsc, Mateusz Czaplinski
CC=golang-dev
https://golang.org/cl/1600041
2010-06-29 20:23:39 -07:00
Kirklin McDonald
0046d51e06
net: add support for DNS SRV requests.
...
Fixes #758 .
R=rsc, adg
CC=golang-dev
https://golang.org/cl/1078041
2010-06-30 10:54:24 +10:00
Vinu Rajashekhar
00ad47f906
Move the function Run() back into fd.go.
...
R=iant
CC=golang-dev, rsc
https://golang.org/cl/1748041
2010-06-29 12:04:04 -07:00
Vinu Rajashekhar
e0334ab798
Move the functions, newPollServer and Run, from fd.go
...
to a new source file.
R=iant, rsc
CC=golang-dev
https://golang.org/cl/1670046
2010-06-28 13:58:56 -07:00
Russ Cox
f374575fb7
net: move Dial, Listen out of net.go.
...
now net.go is only type definitions, not active code.
R=r
CC=golang-dev
https://golang.org/cl/1708046
2010-06-21 19:52:30 -07:00
Christopher Wedgwood
7edd49614c
net: Fix ICMP test.
...
Ping IDs should be limited to 16-bits. Fix failure printing.
R=rsc
CC=golang-dev, jean-christophe smith <jeanchristophe.smith
https://golang.org/cl/1682043
2010-06-21 16:40:44 -07:00
Russ Cox
45bdf0367e
reflect: add Kind, remove Int8Type, Int8Value, etc.
...
update other code to match.
R=r
CC=golang-dev
https://golang.org/cl/1680044
2010-06-20 12:16:25 -07:00
Russ Cox
6aaef04469
misc cleanup: gofmt + &x -> x[0:] conversion
...
R=gri
CC=golang-dev
https://golang.org/cl/1620042
2010-06-08 17:51:57 -07:00
Andrew Gerrand
a63f73c196
net: fix typo
...
Fixes #819 .
R=rsc
CC=golang-dev
https://golang.org/cl/1421041
2010-05-31 07:05:41 +02: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
Christopher Wedgwood
5c19c4e5e3
net: udp, implement BindToDevice
...
R=rsc
CC=golang-dev, r
https://golang.org/cl/1271041
2010-05-24 16:53:23 -07:00
Robert Griesemer
72fd5c80f8
go/printer, gofmt: fix printing of labels,
...
apply gofmt to src, misc
Fixes #752 .
R=rsc
CC=golang-dev
https://golang.org/cl/1240044
2010-05-21 20:25:08 -07:00
Christopher Wedgwood
13d5a19a98
net: implement raw sockets
...
R=rsc
CC=golang-dev
https://golang.org/cl/684041
2010-05-21 17:30:40 -07:00
Michael Hoisie
9192ec2ea1
netFD: fix race between Close and Read/Write
...
Fixes #783 .
R=rsc, cw
CC=golang-dev
https://golang.org/cl/1207043
2010-05-20 17:13:50 -07:00
Conrad Meyer
5789c86fc0
Fix a typo in net/unixsock
...
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1113041
2010-05-05 09:55:11 -07:00
Christopher Wedgwood
b5da6ea4dd
net: use short variable declaration
...
R=rsc
CC=golang-dev
https://golang.org/cl/1019043
2010-04-29 11:02:10 -07:00
Christopher Wedgwood
be9f6344a7
net: parser should handle EOF without newline properly.
...
Fixes #686 .
R=rsc
CC=adg, golang-dev
https://golang.org/cl/979044
2010-04-29 11:01:21 -07:00
Russ Cox
7c77e450cc
net: do not require newline at end of resolv.conf
...
Fixes #686 .
R=adg
CC=golang-dev
https://golang.org/cl/961046
2010-04-28 19:36:04 -07:00
Russ Cox
dc606a20ce
net: drop non-RHEL-4.6 ports from test
...
Fixes #610 .
R=adg
CC=golang-dev
https://golang.org/cl/1006044
2010-04-27 19:04:22 -07:00
Russ Cox
9c8cee712d
net: fix bug in internetSocket introduced by error cleanup.
...
Fixes #750 .
R=adg
CC=golang-dev
https://golang.org/cl/988043
2010-04-27 18:48:11 -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
1d18e89125
net: add Pipe
...
R=r
CC=golang-dev
https://golang.org/cl/1004043
2010-04-26 10:36:05 -07:00
Michael Hoisie
13f81feb31
net: fix bugs in packStructValue
...
packStructValue was cutting off last byte of uint32
in _Dns_msg.Unpack, use packRR for rr types
R=rsc
CC=golang-dev
https://golang.org/cl/844048
2010-04-18 14:46:24 -07:00
Russ Cox
caa149f73d
net: use chan bool instead of chan *netFD to avoid cycle
...
The cycle is *netFD -> cw chanl *netFD in struct ->
same *netFD in channel read buffer.
Because channels are finalized, the cycle makes them
uncollectable. A better fix is to make channels not
finalized anymore, and that will happen, but this is
an easy, reasonable workaround until then.
Another good fix would be to zero the channel receive
buffer entry after the receive. That too will happen.
R=r
CC=golang-dev
https://golang.org/cl/875043
2010-04-06 16:50:27 -07:00
Russ Cox
c7122a3c58
simplify various code using new map index rule
...
R=r
CC=golang-dev
https://golang.org/cl/833044
2010-03-30 10:51:11 -07:00
Russ Cox
00f9f0c056
single argument panic
...
note that sortmain.go has been run through hg gofmt;
only the formatting of the day initializers changed.
i'm happy to revert that formatting if you'd prefer.
stop on error in doc/progs/run
R=r
CC=golang-dev
https://golang.org/cl/850041
2010-03-30 10:34:57 -07:00
Rob Pike
325cf8ef21
delete all uses of panicln by rewriting them using panic or,
...
in the tests, println+panic.
gofmt some tests too.
R=rsc
CC=golang-dev
https://golang.org/cl/741041
2010-03-24 16:46:53 -07:00
Russ Cox
0b986316b8
net: fix IPMask.String not to crash on all-0xff mask
...
R=r
CC=golang-dev
https://golang.org/cl/438042
2010-03-16 14:16:33 -07:00
Russ Cox
e53f7d8993
net: put [ ] around IPv6 addresses for Dial
...
Update #538 .
R=r
CC=golang-dev
https://golang.org/cl/229045
2010-03-03 17:30:39 -08:00
Russ Cox
74b131c0ab
net: fix nil deref in testTimeout when Dial fails
...
Pointed out by Scott Schwartz.
Fixes #637 .
R=scotts
CC=golang-dev
https://golang.org/cl/225042
2010-03-03 17:30:29 -08:00
Stephen Ma
3b82f295b4
net: fix network timeout boundary condition.
...
Fixes #472 .
R=golang-dev
CC=golang-dev
https://golang.org/cl/223108
2010-03-03 18:43:36 +11:00
Stephen Ma
b73e592ed1
net: correct DNS configuration
...
Set defaults to the same values as various C DNS resolver libraries.
Use the timeout value from the configuration.
Fixes #632 .
R=rsc
CC=golang-dev
https://golang.org/cl/223094
2010-03-03 15:25:26 +11:00
Robert Griesemer
f44fa9b4c7
gofmt: experiment: align values in map composites where possible
...
- gofmt -w src misc
- looking for feedback
R=rsc, r
CC=golang-dev
https://golang.org/cl/223076
2010-03-02 13:46:51 -08: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
Stephen Weinberg
b86c0b0c4a
Fix small typo in net package.
...
R=rsc
CC=golang-dev
https://golang.org/cl/224061
2010-02-25 14:49:14 -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
Russ Cox
c312d0e0ca
net: use slightly less predictable dns request id
...
not trying to be secure, just not repetitive
(sending with the same id repeatedly makes
some resolvers stop replying.)
eventually we'll replace this with linking against
the system's native resolver.
R=p
CC=golang-dev
https://golang.org/cl/207051
2010-02-10 16:35:35 -08:00
Michael Hoisie
dd97923d82
net: fix segfault if /etc/hosts fails to open or doesn't exist
...
R=rsc
CC=golang-dev, r
https://golang.org/cl/194043
2010-01-26 16:18:29 -08:00
Andrey Mirtchovski
3fc41d5e65
net: parse aliases in /etc/hosts correctly
...
Previous behaviour only picked the first entry (official hostname) but not the aliases.
R=rsc
CC=golang-dev
https://golang.org/cl/193092
2010-01-25 14:57:04 -08:00
Russ Cox
7c1bb00374
net: enable UDP broadcast before it is needed (instead of after)
...
Fixes #526 .
R=r
CC=golang-dev
https://golang.org/cl/186211
2010-01-18 15:59:32 -08:00
Yves Junqueira
d6054fcd88
Use /etc/hosts when resolving names.
...
http://code.google.com/p/go/issues/detail?id=313
This conflics with Chris' patch at:
https://golang.org/cl/181063
But I believe this is more complete since it has a simple caching and proper tests.
R=cw, rsc
CC=golang-dev
https://golang.org/cl/183066
2010-01-15 13:43:14 -08:00
Roger Peppe
0281b71580
net: make Dial correctly return nil on error.
...
R=rsc
CC=golang-dev
https://golang.org/cl/181135
2010-01-05 09:20:02 -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
Robert Griesemer
2e4334eb3a
minor manual format corrections
...
R=rsc
https://golang.org/cl/172042
2009-12-09 16:54:24 -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