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

Delta Between Two Patch Sets: src/pkg/net/sendfile_linux.go

Issue 6496054: code review 6496054: net: spread fd over several pollservers. (Closed)
Left Patch Set: diff -r ee8276dbea49 https://code.google.com/p/go/ Created 11 years, 6 months ago
Right Patch Set: diff -r cfbcf8176d26 https://code.google.com/p/go/ Created 11 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/net/sendfile_freebsd.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
52 } 52 }
53 n, err1 := syscall.Sendfile(dst, src, nil, n) 53 n, err1 := syscall.Sendfile(dst, src, nil, n)
54 if n > 0 { 54 if n > 0 {
55 written += int64(n) 55 written += int64(n)
56 remain -= int64(n) 56 remain -= int64(n)
57 } 57 }
58 if n == 0 && err1 == nil { 58 if n == 0 && err1 == nil {
59 break 59 break
60 } 60 }
61 if err1 == syscall.EAGAIN && c.wdeadline >= 0 { 61 if err1 == syscall.EAGAIN && c.wdeadline >= 0 {
62 » » » if err1 = c.pollServer().WaitWrite(c); err1 == nil { 62 » » » if err1 = c.pollServer.WaitWrite(c); err1 == nil {
mikio 2012/09/19 21:57:11 sendfile_freebsd.go needs the same change too.
Sebastien Paolacci 2012/09/19 22:13:51 Done, thanks.
63 continue 63 continue
64 } 64 }
65 } 65 }
66 if err1 != nil { 66 if err1 != nil {
67 // This includes syscall.ENOSYS (no kernel 67 // This includes syscall.ENOSYS (no kernel
68 // support) and syscall.EINVAL (fd types which 68 // support) and syscall.EINVAL (fd types which
69 // don't implement sendfile together) 69 // don't implement sendfile together)
70 err = &OpError{"sendfile", c.net, c.raddr, err1} 70 err = &OpError{"sendfile", c.net, c.raddr, err1}
71 break 71 break
72 } 72 }
73 } 73 }
74 if lr != nil { 74 if lr != nil {
75 lr.N = remain 75 lr.N = remain
76 } 76 }
77 return written, err, written > 0 77 return written, err, written > 0
78 } 78 }
LEFTRIGHT

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