Chromium Code Reviews| Index: components/cronet/ios/cronet_bidirectional_stream.cc |
| diff --git a/components/cronet/ios/cronet_bidirectional_stream.cc b/components/cronet/ios/cronet_bidirectional_stream.cc |
| index e229fcd1ec5d34a501a3ff3eb44b07b7bd7aa3f8..c5e091d5c7d2d9f40570ea166dc703b1d43beacd 100644 |
| --- a/components/cronet/ios/cronet_bidirectional_stream.cc |
| +++ b/components/cronet/ios/cronet_bidirectional_stream.cc |
| @@ -208,7 +208,9 @@ void CronetBidirectionalStream::ReadDataOnNetworkThread( |
| DCHECK(!read_buffer_); |
| if (read_state_ != WAITING_FOR_READ) { |
| DLOG(ERROR) << "Unexpected Read Data in read_state " << WAITING_FOR_READ; |
| - OnFailed(net::ERR_UNEXPECTED); |
| + // Invoke OnFailed unless it is already invoked. |
| + if (read_state_ != ERROR) |
| + OnFailed(net::ERR_UNEXPECTED); |
| return; |
| } |
| read_state_ = READING; |
| @@ -235,7 +237,9 @@ void CronetBidirectionalStream::WriteDataOnNetworkThread( |
| DCHECK(!write_buffer_); |
| if (write_state_ != WAITING_FOR_WRITE) { |
| DLOG(ERROR) << "Unexpected Write Data in write_state " << write_state_; |
| - OnFailed(net::ERR_UNEXPECTED); |
| + // Invoke OnFailed unless it is already invoked. |
| + if (write_state_ != ERROR) |
| + OnFailed(net::ERR_UNEXPECTED); |
|
xunjieli
2016/04/28 15:23:33
If the request has been canceled, we probably coul
mef
2016/04/28 17:11:26
That's an interesting point. I think we shouldn't
xunjieli
2016/04/28 20:20:45
I am not sure. Either approach is fine with me as
|
| return; |
| } |
| write_state_ = WRITING; |