summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-03-07 13:50:13 -0500
committerGitHub <noreply@github.com>2017-03-07 13:50:13 -0500
commit23f698b0a594c02af38c2485e0b55179e5d04333 (patch)
tree8dfbb087e327cafaeec9425cfef7fbe22e1ff5b5
parent5179d7f7a2bac9aa541f130713b461074045fb26 (diff)
parent7e046fa962f7be6949452f2e43ada06dd51be523 (diff)
downloadsdl_ios-23f698b0a594c02af38c2485e0b55179e5d04333.tar.gz
Merge pull request #565 from davidswi/hotfix/issue_522_hang
Fix issue around premature stream close resulting in hangs in iAP transmit queue
-rw-r--r--SmartDeviceLink/SDLIAPTransport.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m
index 5cf4ceb21..b90296d07 100644
--- a/SmartDeviceLink/SDLIAPTransport.m
+++ b/SmartDeviceLink/SDLIAPTransport.m
@@ -272,8 +272,8 @@ int const streamOpenTimeoutSeconds = 2;
NSOutputStream *ostream = self.session.easession.outputStream;
NSMutableData *remainder = data.mutableCopy;
- while (remainder.length != 0) {
- if (ostream.streamStatus == NSStreamStatusOpen && ostream.hasSpaceAvailable) {
+ while (ostream.streamStatus == NSStreamStatusOpen && remainder.length != 0) {
+ if (ostream.hasSpaceAvailable){
NSInteger bytesWritten = [ostream write:remainder.bytes maxLength:remainder.length];
if (bytesWritten == -1) {