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

Issue 69870051: net: added sendfile support for io.SectionReader

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by mpk
Modified:
10 years ago
Visibility:
Public.

Description

net: added sendfile support for io.SectionReader 3 points to note. SectionReader now exports ReaderAt in same way as the LimitedReader. Offset and Remaining bytes use methods instead as it seemed cleaner that way. General support for Darwin was added which makes it identical to dragonfly and freebsd (should possibly be refactored into one). The test for linux uses similar approach to the net/http/fs_test.go which I know is not ideal. Fixes issue 6374.

Patch Set 1 #

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

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+303 lines, -9 lines) Patch
M src/pkg/io/io.go View 1 3 chunks +11 lines, -5 lines 1 comment Download
A src/pkg/net/sendfile_darwin.go View 1 1 chunk +112 lines, -0 lines 0 comments Download
M src/pkg/net/sendfile_dragonfly.go View 1 3 chunks +10 lines, -1 line 0 comments Download
M src/pkg/net/sendfile_freebsd.go View 1 3 chunks +10 lines, -1 line 0 comments Download
M src/pkg/net/sendfile_linux.go View 1 3 chunks +12 lines, -1 line 0 comments Download
M src/pkg/net/sendfile_stub.go View 1 1 chunk +1 line, -1 line 0 comments Download
A src/pkg/net/sendfile_test.go View 1 1 chunk +147 lines, -0 lines 0 comments Download

Messages

Total messages: 3
mpk
10 years, 1 month ago (2014-03-05 14:13:21 UTC) #1
bradfitz
I think this is probably too large and invasive for Go 1.3 (notably invasive: it ...
10 years, 1 month ago (2014-03-05 19:58:10 UTC) #2
bradfitz
10 years ago (2014-04-06 15:56:55 UTC) #3
https://codereview.appspot.com/69870051/diff/20001/src/pkg/io/io.go
File src/pkg/io/io.go (right):

https://codereview.appspot.com/69870051/diff/20001/src/pkg/io/io.go#newcode471
src/pkg/io/io.go:471: func (s *SectionReader) Offset() int64 { return s.off }
think you'd want s.off - s.base here anyway.  Or you'd at least want to explain
which offset you mean in the docs.
Sign in to reply to this message.

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