You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while !sOperation.isCancelled {letstream= s.stream
letwriteBuffer=UnsafeRawPointer(frame!.bytes+total).assumingMemoryBound(to:UInt8.self)letlen= stream.write(data:Data(bytes: writeBuffer, count: offset-total))
if len <0{varerror:Error?leterrCode=InternalErrorCode.outputStreamWriteError.rawValue
error = s.errorWithDetail("output stream error during write", code: errCode)
s.doDisconnect(error)
break
}else{
total += len
}
When the 'len' returned from stream.write is 0(inside write function, 0 is returned when outputStream is nil), therefore 'total' will not be increased, leading to infinite loop.
For a quick fix, is it OK to change the if statement 'len < 0' to 'len <= 0' so the loop would exit through error handling logic, to resolve the issue for now?
The text was updated successfully, but these errors were encountered:
In WebSocket.swift(near line 1248)
When the 'len' returned from stream.write is 0(inside write function, 0 is returned when outputStream is nil), therefore 'total' will not be increased, leading to infinite loop.
For a quick fix, is it OK to change the if statement 'len < 0' to 'len <= 0' so the loop would exit through error handling logic, to resolve the issue for now?
The text was updated successfully, but these errors were encountered: