fix error handling in CFWriteStreamWrite

pull/37344/head
Hannah Shi 4 months ago
parent d7861e82f6
commit c9a751d9d7
  1. 11
      src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc

@ -335,9 +335,18 @@ void CFStreamEndpointImpl::DoWrite(
continue;
}
size_t written_size =
CFIndex written_size =
CFWriteStreamWrite(cf_write_stream_, slice.begin(), slice.size());
if (written_size < 0) {
auto status = CFErrorToStatus(CFWriteStreamCopyError(cf_write_stream_));
GRPC_TRACE_LOG(event_engine_endpoint, INFO)
<< "CFStream write error: " << status
<< ", written_size: " << written_size;
on_writable(status);
return;
}
total_written_size += written_size;
if (written_size < slice.size()) {
SliceBuffer written;

Loading…
Cancel
Save