Skip to content

Commit 84b784a

Browse files
committed
net: use same sendFile for freebsd/dragonfly and solaris
FreeBSD/Dragonfly and Solaris have identical implementations of sendFile. Keep one and adjust the comments accordingly. Change-Id: I77b0f88a4816dd6e40f5cb33919c44606401ac6b Reviewed-on: https://go-review.googlesource.com/104915 Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 92c29ef commit 84b784a

File tree

2 files changed

+3
-66
lines changed

2 files changed

+3
-66
lines changed

src/net/sendfile_solaris.go

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/net/sendfile_bsd.go renamed to src/net/sendfile_unix_alt.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build dragonfly freebsd
5+
// +build dragonfly freebsd solaris
66

77
package net
88

@@ -20,7 +20,7 @@ import (
2020
//
2121
// if handled == false, sendFile performed no work.
2222
func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) {
23-
// FreeBSD and DragonFly use 0 as the "until EOF" value.
23+
// FreeBSD, DragonFly and Solaris use 0 as the "until EOF" value.
2424
// If you pass in more bytes than the file contains, it will
2525
// loop back to the beginning ad nauseam until it's sent
2626
// exactly the number of bytes told to. As such, we need to
@@ -48,7 +48,7 @@ func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) {
4848
remain = fi.Size()
4949
}
5050

51-
// The other quirk with FreeBSD/DragonFly's sendfile
51+
// The other quirk with FreeBSD/DragonFly/Solaris's sendfile
5252
// implementation is that it doesn't use the current position
5353
// of the file -- if you pass it offset 0, it starts from
5454
// offset 0. There's no way to tell it "start from current

0 commit comments

Comments
 (0)