Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 557d401

Browse files
committedJan 23, 2016
work on debugging some issues
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
1 parent a2b0287 commit 557d401

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed
 

‎Godeps/_workspace/src/github.com/whyrusleeping/go-multistream/lazy.go

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎p2p/host/basic/basic_host.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func (h *BasicHost) NewStream(pid protocol.ID, p peer.ID) (inet.Stream, error) {
173173
lzcon := msmux.NewMSSelect(logStream, string(pid))
174174
return &streamWrapper{
175175
Stream: logStream,
176-
rw: lzcon,
176+
rwc: lzcon,
177177
}, nil
178178
}
179179

@@ -256,13 +256,17 @@ func (h *BasicHost) GetBandwidthReporter() metrics.Reporter {
256256

257257
type streamWrapper struct {
258258
inet.Stream
259-
rw io.ReadWriter
259+
rwc io.ReadWriteCloser
260260
}
261261

262262
func (s *streamWrapper) Read(b []byte) (int, error) {
263-
return s.rw.Read(b)
263+
return s.rwc.Read(b)
264264
}
265265

266266
func (s *streamWrapper) Write(b []byte) (int, error) {
267-
return s.rw.Write(b)
267+
return s.rwc.Write(b)
268+
}
269+
270+
func (s *streamWrapper) Close() error {
271+
return s.rwc.Close()
268272
}

0 commit comments

Comments
 (0)
Please sign in to comment.