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

Issue 15960047: code review 15960047: net: handle single-line non-\n-terminated files correct... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by josharian
Modified:
10 years, 5 months ago
Reviewers:
bradfitz
CC:
rsc, bradfitz, golang-dev
Visibility:
Public.

Description

net: handle single-line non-\n-terminated files correctly in readLine Fixes issue 6646.

Patch Set 1 #

Patch Set 2 : diff -r f257b02e7ffe https://code.google.com/p/go #

Patch Set 3 : diff -r f257b02e7ffe https://code.google.com/p/go #

Patch Set 4 : diff -r f257b02e7ffe https://code.google.com/p/go #

Patch Set 5 : diff -r f257b02e7ffe https://code.google.com/p/go #

Patch Set 6 : diff -r f257b02e7ffe https://code.google.com/p/go #

Total comments: 2

Patch Set 7 : diff -r f257b02e7ffe https://code.google.com/p/go #

Total comments: 2

Patch Set 8 : diff -r f257b02e7ffe https://code.google.com/p/go #

Patch Set 9 : diff -r f257b02e7ffe https://code.google.com/p/go #

Patch Set 10 : diff -r f257b02e7ffe https://code.google.com/p/go #

Patch Set 11 : diff -r f257b02e7ffe https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -1 line) Patch
M src/pkg/net/hosts_test.go View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
M src/pkg/net/parse.go View 1 1 chunk +1 line, -1 line 0 comments Download
A src/pkg/net/testdata/hosts_singleline View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 18
josharian
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
10 years, 6 months ago (2013-10-23 17:47:04 UTC) #1
bradfitz
Not a fix without a test. On Wed, Oct 23, 2013 at 10:47 AM, <josharian@gmail.com> ...
10 years, 6 months ago (2013-10-23 17:48:14 UTC) #2
rsc
You can test the reading of /etc/hosts instead of the reading of /etc/resolv.conf. See TestLookupStaticHost.
10 years, 6 months ago (2013-10-23 17:54:02 UTC) #3
josharian
> You can test the reading of /etc/hosts instead of the reading of > /etc/resolv.conf. ...
10 years, 6 months ago (2013-10-23 17:55:33 UTC) #4
josharian
Hello rsc@golang.org, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
10 years, 6 months ago (2013-10-23 18:13:30 UTC) #5
bradfitz
https://codereview.appspot.com/15960047/diff/20002/src/pkg/net/hosts_test.go File src/pkg/net/hosts_test.go (right): https://codereview.appspot.com/15960047/diff/20002/src/pkg/net/hosts_test.go#newcode68 src/pkg/net/hosts_test.go:68: hostsPath = p nit that probably doesn't matter: this ...
10 years, 6 months ago (2013-10-23 18:17:10 UTC) #6
josharian
On 2013/10/23 18:17:10, bradfitz wrote: > https://codereview.appspot.com/15960047/diff/20002/src/pkg/net/hosts_test.go > File src/pkg/net/hosts_test.go (right): > > https://codereview.appspot.com/15960047/diff/20002/src/pkg/net/hosts_test.go#newcode68 > ...
10 years, 6 months ago (2013-10-23 18:18:24 UTC) #7
rsc
https://codereview.appspot.com/15960047/diff/20002/src/pkg/net/hosts_test.go File src/pkg/net/hosts_test.go (right): https://codereview.appspot.com/15960047/diff/20002/src/pkg/net/hosts_test.go#newcode61 src/pkg/net/hosts_test.go:61: if len(ips) != 1 { you can avoid brad's ...
10 years, 6 months ago (2013-10-23 18:18:52 UTC) #8
josharian
> you can avoid brad's comment about Fatalf by merging the tests: The other test ...
10 years, 6 months ago (2013-10-23 18:22:13 UTC) #9
josharian
Fixed the corresponding problem in TestLookupStaticHost; kept the defer for TestSingleLineHostsFile for symmetry. Merged the ...
10 years, 6 months ago (2013-10-23 18:29:21 UTC) #10
rsc
The other test did not have the problem, because it did not call Fatalf.
10 years, 6 months ago (2013-10-23 18:32:48 UTC) #11
rsc
https://codereview.appspot.com/15960047/diff/90001/src/pkg/net/hosts_test.go File src/pkg/net/hosts_test.go (right): https://codereview.appspot.com/15960047/diff/90001/src/pkg/net/hosts_test.go#newcode36 src/pkg/net/hosts_test.go:36: defer func(orig string) { this is unnecessarily complex; please ...
10 years, 6 months ago (2013-10-23 18:33:41 UTC) #12
josharian
> The other test did not have the problem, because it did not call Fatalf. ...
10 years, 6 months ago (2013-10-23 18:35:43 UTC) #13
bradfitz
On Wed, Oct 23, 2013 at 11:32 AM, Russ Cox <rsc@golang.org> wrote: > The other ...
10 years, 6 months ago (2013-10-23 18:36:06 UTC) #14
josharian
Third time's a charm? Please take another look. > this is unnecessarily complex; please put ...
10 years, 6 months ago (2013-10-23 18:52:46 UTC) #15
josharian
On 2013/10/23 18:52:46, josharian wrote: > Third time's a charm? Please take another look. > ...
10 years, 6 months ago (2013-10-24 22:11:15 UTC) #16
bradfitz
LGTM Russ?
10 years, 6 months ago (2013-10-25 04:13:58 UTC) #17
rsc
10 years, 6 months ago (2013-10-28 23:31:31 UTC) #18
*** Submitted as https://code.google.com/p/go/source/detail?r=a0d4544cdb2a ***

net: handle single-line non-\n-terminated files correctly in readLine

Fixes issue 6646.

R=rsc, bradfitz
CC=golang-dev
https://codereview.appspot.com/15960047

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

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