LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 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 package net | 5 package net |
6 | 6 |
7 import ( | 7 import ( |
8 "io" | 8 "io" |
9 "os" | 9 "os" |
10 "syscall" | 10 "syscall" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 return 0, err, true | 52 return 0, err, true |
53 } | 53 } |
54 defer c.decref() | 54 defer c.decref() |
55 c.wio.Lock() | 55 c.wio.Lock() |
56 defer c.wio.Unlock() | 56 defer c.wio.Unlock() |
57 | 57 |
58 var o sendfileOp | 58 var o sendfileOp |
59 o.Init(c, 'w') | 59 o.Init(c, 'w') |
60 o.n = uint32(n) | 60 o.n = uint32(n) |
61 o.src = syscall.Handle(f.Fd()) | 61 o.src = syscall.Handle(f.Fd()) |
62 » done, err := iosrv.ExecIO(&o, 0) | 62 » done, err := iosrv.ExecIO(&o) |
63 if err != nil { | 63 if err != nil { |
64 return 0, err, false | 64 return 0, err, false |
65 } | 65 } |
66 if lr != nil { | 66 if lr != nil { |
67 lr.N -= int64(done) | 67 lr.N -= int64(done) |
68 } | 68 } |
69 return int64(done), nil, true | 69 return int64(done), nil, true |
70 } | 70 } |
LEFT | RIGHT |