diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2018-02-09 14:36:43 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2018-02-09 14:36:43 -0500 |
commit | cd8eaec7a5ae070325f8b822dbce122d7ff10c37 (patch) | |
tree | dd114d59b24fc7bfe6f9e63ac7bdfa0eb37d2ccf | |
parent | 96f2b8d8bddd99cc759ba9e94f1130ac8e4daf4e (diff) | |
download | sdl_ios-bug/issue_850_output_stream_warning.tar.gz |
Check if output stream has space before sending databug/issue_850_output_stream_warning
-rw-r--r-- | SmartDeviceLink/SDLIAPSession.m | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLIAPSession.m b/SmartDeviceLink/SDLIAPSession.m index 33a7cf1f1..47047ece9 100644 --- a/SmartDeviceLink/SDLIAPSession.m +++ b/SmartDeviceLink/SDLIAPSession.m @@ -125,6 +125,10 @@ NSTimeInterval const StreamThreadWaitSecs = 1.0; - (void)sdl_dequeueAndWriteToOutputStream { NSOutputStream *ostream = self.easession.outputStream; + if (!ostream.hasSpaceAvailable) { + return; + } + NSMutableData *remainder = [self.sendDataQueue frontBuffer]; if (remainder != nil && ostream.streamStatus == NSStreamStatusOpen) { |