| 872 | } |
| 873 | |
| 874 | int StreamAccept(StreamId* response_stream, Controller &cntl, |
| 875 | const StreamOptions* options) { |
| 876 | if (response_stream == NULL) { |
| 877 | LOG(ERROR) << "response_stream is NULL"; |
| 878 | return -1; |
| 879 | } |
| 880 | StreamIds response_streams; |
| 881 | int res = StreamAccept(response_streams, cntl, options); |
| 882 | if(res != 0) { |
| 883 | return res; |
| 884 | } |
| 885 | if(response_streams.size() != 1) { |
| 886 | Stream::SetFailed(response_streams, EINVAL, |
| 887 | "misusing StreamAccept for single stream to accept multiple streams"); |
| 888 | cntl._response_streams.clear(); |
| 889 | LOG(ERROR) << "misusing StreamAccept for single stream to accept multiple streams"; |
| 890 | return -1; |
| 891 | } |
| 892 | *response_stream = response_streams[0]; |
| 893 | return 0; |
| 894 | } |
| 895 | |
| 896 | int StreamAccept(StreamIds& response_streams, Controller& cntl, |
| 897 | const StreamOptions* options) { |