1
0
mirror of https://github.com/golang/go synced 2024-10-01 16:38:34 -06:00
Commit Graph

7 Commits

Author SHA1 Message Date
Morten Siebuhr
002c69e05d net: fix looking up port numbers starting with numbers.
LookupPort() correctly parses service names beginning with numerals by
implementing a new parser, mainly taken from strconv/atoi.go.

Also testes some previously undefined behaviours around port numbers
larger than 65535 that previously could lead to some tests fail with
EOPNOTSUPP (Operation Not Supported).

Fixes #14322

Change-Id: I1b90dbed434494723e261d84e73fe705e5c0507a
Reviewed-on: https://go-review.googlesource.com/19720
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2016-04-15 23:11:47 +00:00
Mikio Hara
91977d07fe net: move TestLookupPort into lookup_test.go
No code changes.

Change-Id: Ibbba7c86007d74b853fb59aa742f87783bd69503
Reviewed-on: https://go-review.googlesource.com/16541
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-11-21 02:59:54 +00:00
Mikio Hara
b50b21d3e1 net: make Dial, Listen{,Packet} for TCP/UDP with invalid port fail
This change makes Dial, Listen and ListenPacket with invalid port fail
whatever GODEBUG=netdns is.

Please be informed that cgoLookupPort with an out of range literal
number may return either the lower or upper bound value, 0 or 65535,
with no error on some platform.

Fixes #11715.

Change-Id: I43f9c4fb5526d1bf50b97698e0eb39d29fd74c35
Reviewed-on: https://go-review.googlesource.com/12447
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-11-01 05:28:17 +00:00
Russ Cox
35365b97f1 net: restore LookupPort for integer strings
This worked in Go 1.4 but was lost in the "pure Go" lookup
routines substituted late in the Go 1.5 cycle.

Fixes #12263.

Change-Id: I77ec9d97cd8e67ace99d6ac965e5bc16c151ba83
Reviewed-on: https://go-review.googlesource.com/13915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-08-27 16:17:21 +00:00
Mikio Hara
f77e10fb2e net: simplify error messages in tests
This change simplifies unnecessarily redundant error messages in tests.
There's no need to worry any more because package APIs now return
consistent, self-descriptive error values.

Alos renames ambiguous test functions and makes use of test tables.

Change-Id: I7b61027607c4ae2a3cf605d08d58cf449fa27eb2
Reviewed-on: https://go-review.googlesource.com/9662
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
2015-05-06 09:25:08 +00:00
Mikio Hara
484cc67151 net: separate NaCl dependent placeholders from BSD's
To clarify the dependency of NaCl platform.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/143830044
2014-09-18 19:17:55 +09:00
Russ Cox
c007ce824d build: move package sources from src/pkg to src
Preparation was in CL 134570043.
This CL contains only the effect of 'hg mv src/pkg/* src'.
For more about the move, see golang.org/s/go14nopkg.
2014-09-08 00:08:51 -04:00