summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-02-15 13:29:20 -0500
committerGitHub <noreply@github.com>2018-02-15 13:29:20 -0500
commit198f1615c20aedb4efe312efd80fce170ed88c9a (patch)
tree51b31ac74ba76d859760c3f0b352e99be47cf027
parenta3cbeb67803d88de12ec2fd9a24d5cc96e6c027f (diff)
parentcd8eaec7a5ae070325f8b822dbce122d7ff10c37 (diff)
downloadsdl_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.m4
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) {