code: func (p *httpStreamPair) add(stream httpstream.Stream) (bool, error) {
  	p.lock.Lock()
  	defer p.lock.Unlock()
  
  	switch stream.Headers().Get(StreamType) {
  	case StreamTypeError:
  		if p.errorStream != nil {
  			return false, trace.BadParameter("error stream already assigned")
  		}
  		p.errorStream = stream
  	case StreamTypeData:
  		if p.dataStream != nil {
  			return false, trace.BadParameter("data stream already assigned")
  		}
  		p.dataStream = stream
  	}
  
  	complete := p.errorStream != nil && p.dataStream != nil
  	if complete {
  		close(p.complete)
  	}
  	return complete, nil
  }
docs: // add adds the stream to the httpStreamPair. If the pair already
  // contains a stream for the new stream's type, an error is returned. add
  // returns true if both the data and error streams for this pair have been
  // received.