Skip to content

Commit

Permalink
Merge Alex's PR
Browse files Browse the repository at this point in the history
  • Loading branch information
林志宇 committed May 30, 2019
2 parents c047444 + 0b6ebd5 commit 141df25
Show file tree
Hide file tree
Showing 16 changed files with 319 additions and 316 deletions.
3 changes: 2 additions & 1 deletion pkg/dms/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func (c *Channel) Write(p []byte) (int, error) {
func (c *Channel) Close() error {
if c.close() {
_ = writeFrame(c.Conn, MakeFrame(CloseType, c.id, []byte{0}))
return nil
}
return nil
return io.ErrClosedPipe
}
2 changes: 1 addition & 1 deletion pkg/messaging/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (mCh *msgChannel) readEncrypted(ctx context.Context, p []byte) (n int, err
}

if len(data) > len(p) {
if _, err := mCh.buf.Write(data[len(p):]); err != nil {
if _, err := mCh.buf.Write(data[len(p):]); err != nil { // TODO: data race.
return 0, io.ErrShortBuffer
}

Expand Down
Loading

0 comments on commit 141df25

Please sign in to comment.