LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 //build darwin freebsd linux openbsd windows | 5 // +build darwin freebsd linux openbsd windows |
6 | 6 |
7 // Sockets | 7 // Sockets |
8 | 8 |
9 package net | 9 package net |
10 | 10 |
11 import ( | 11 import ( |
12 "io" | 12 "io" |
13 "os" | 13 "os" |
14 "reflect" | 14 "reflect" |
15 "syscall" | 15 "syscall" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 type writerOnly struct { | 159 type writerOnly struct { |
160 io.Writer | 160 io.Writer |
161 } | 161 } |
162 | 162 |
163 // Fallback implementation of io.ReaderFrom's ReadFrom, when sendfile isn't | 163 // Fallback implementation of io.ReaderFrom's ReadFrom, when sendfile isn't |
164 // applicable. | 164 // applicable. |
165 func genericReadFrom(w io.Writer, r io.Reader) (n int64, err os.Error) { | 165 func genericReadFrom(w io.Writer, r io.Reader) (n int64, err os.Error) { |
166 // Use wrapper to hide existing r.ReadFrom from io.Copy. | 166 // Use wrapper to hide existing r.ReadFrom from io.Copy. |
167 return io.Copy(writerOnly{w}, r) | 167 return io.Copy(writerOnly{w}, r) |
168 } | 168 } |
LEFT | RIGHT |