diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2018-02-15 13:29:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-15 13:29:20 -0500 |
commit | 198f1615c20aedb4efe312efd80fce170ed88c9a (patch) | |
tree | 51b31ac74ba76d859760c3f0b352e99be47cf027 | |
parent | a3cbeb67803d88de12ec2fd9a24d5cc96e6c027f (diff) | |
parent | cd8eaec7a5ae070325f8b822dbce122d7ff10c37 (diff) | |
download | sdl_ios-198f1615c20aedb4efe312efd80fce170ed88c9a.tar.gz |
Merge pull request #866 from smartdevicelink/bug/issue_850_output_stream_warning
Check if output stream has space before sending data
-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) { |