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

Side by Side Diff: src/pkg/net/sock_posix.go

Issue 11691044: code review 11691044: net: make use of noDeadline instead of time.Time{} (Closed)
Patch Set: diff -r e560004b817d https://code.google.com/p/go Created 11 years, 8 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:
View unified diff | Download patch
« no previous file with comments | « src/pkg/net/fd_posix_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 netbsd openbsd windows 5 // +build darwin freebsd linux netbsd openbsd windows
6 6
7 package net 7 package net
8 8
9 import ( 9 import (
10 "syscall" 10 "syscall"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if ursa != nil { 56 if ursa != nil {
57 if !deadline.IsZero() { 57 if !deadline.IsZero() {
58 setWriteDeadline(fd, deadline) 58 setWriteDeadline(fd, deadline)
59 } 59 }
60 if err = fd.connect(ulsa, ursa); err != nil { 60 if err = fd.connect(ulsa, ursa); err != nil {
61 fd.Close() 61 fd.Close()
62 return nil, err 62 return nil, err
63 } 63 }
64 fd.isConnected = true 64 fd.isConnected = true
65 if !deadline.IsZero() { 65 if !deadline.IsZero() {
66 » » » setWriteDeadline(fd, time.Time{}) 66 » » » setWriteDeadline(fd, noDeadline)
67 } 67 }
68 } 68 }
69 69
70 lsa, _ := syscall.Getsockname(s) 70 lsa, _ := syscall.Getsockname(s)
71 laddr := toAddr(lsa) 71 laddr := toAddr(lsa)
72 rsa, _ := syscall.Getpeername(s) 72 rsa, _ := syscall.Getpeername(s)
73 if rsa == nil { 73 if rsa == nil {
74 rsa = ursa 74 rsa = ursa
75 } 75 }
76 raddr := toAddr(rsa) 76 raddr := toAddr(rsa)
77 fd.setAddr(laddr, raddr) 77 fd.setAddr(laddr, raddr)
78 return fd, nil 78 return fd, nil
79 } 79 }
OLDNEW
« no previous file with comments | « src/pkg/net/fd_posix_test.go ('k') | no next file » | no next file with comments »

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