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

Side by Side Diff: src/pkg/netchan/import.go

Issue 4301043: update tree for reflect changes (Closed)
Patch Set: diff -r f692a5e90f6f https://go.googlecode.com/hg/ Created 13 years 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/netchan/export.go ('k') | src/pkg/rpc/server.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Go Authors. All rights reserved. 1 // Copyright 2010 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 netchan 5 package netchan
6 6
7 import ( 7 import (
8 "io" 8 "io"
9 "log" 9 "log"
10 "net" 10 "net"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 126 }
127 if nch.dir != Recv { 127 if nch.dir != Recv {
128 impLog("cannot happen: receive from non-Recv channel") 128 impLog("cannot happen: receive from non-Recv channel")
129 return 129 return
130 } 130 }
131 // Acknowledge receipt 131 // Acknowledge receipt
132 ackHdr.Id = hdr.Id 132 ackHdr.Id = hdr.Id
133 ackHdr.SeqNum = hdr.SeqNum 133 ackHdr.SeqNum = hdr.SeqNum
134 imp.encode(ackHdr, payAck, nil) 134 imp.encode(ackHdr, payAck, nil)
135 // Create a new value for each received item. 135 // Create a new value for each received item.
136 » » value := reflect.MakeZero(nch.ch.Type().(*reflect.ChanType).Elem ()) 136 » » value := reflect.MakeZero(nch.ch.Type().Elem())
137 if e := imp.decode(value); e != nil { 137 if e := imp.decode(value); e != nil {
138 impLog("importer value decode:", e) 138 impLog("importer value decode:", e)
139 return 139 return
140 } 140 }
141 nch.send(value) 141 nch.send(value)
142 } 142 }
143 } 143 }
144 144
145 func (imp *Importer) getChan(id int, errOk bool) *netChan { 145 func (imp *Importer) getChan(id int, errOk bool) *netChan {
146 imp.chanLock.Lock() 146 imp.chanLock.Lock()
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 defer imp.chanLock.Unlock() 237 defer imp.chanLock.Unlock()
238 nc := imp.names[name] 238 nc := imp.names[name]
239 if nc == nil { 239 if nc == nil {
240 return os.ErrorString("netchan import: hangup: no such channel: " + name) 240 return os.ErrorString("netchan import: hangup: no such channel: " + name)
241 } 241 }
242 imp.names[name] = nil, false 242 imp.names[name] = nil, false
243 imp.chans[nc.id] = nil, false 243 imp.chans[nc.id] = nil, false
244 nc.close() 244 nc.close()
245 return nil 245 return nil
246 } 246 }
OLDNEW
« no previous file with comments | « src/pkg/netchan/export.go ('k') | src/pkg/rpc/server.go » ('j') | no next file with comments »

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