make stream.Write() return remote errors

This commit is contained in:
Lucas Clemente
2016-04-26 14:41:02 +02:00
parent b9f37f9618
commit 5db81d8874
2 changed files with 11 additions and 0 deletions

View File

@@ -140,6 +140,9 @@ func (s *stream) ReadByte() (byte, error) {
}
func (s *stream) Write(p []byte) (int, error) {
if s.remoteErr != nil {
return 0, s.remoteErr
}
data := make([]byte, len(p))
copy(data, p)
err := s.session.QueueFrame(&frames.StreamFrame{