Skip to content

Commit

Permalink
Kitura/Kitura#33 Fixed buffering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuelk committed Nov 1, 2016
1 parent bba6f9b commit c24b926
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/KituraWebSocket/WebSocketClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class WebSocketClient {
buffer.length = 0
WSFrame.createFrameHeader(finalFrame: true, opCode: withOpCode, payloadLength: payload.length, buffer: buffer)

if WebSocketClient.bufferSize <= buffer.length + payload.length {
if WebSocketClient.bufferSize >= buffer.length + payload.length {
buffer.append(payload.bytes, length: payload.length)
processor.write(from: buffer)
}
Expand Down

0 comments on commit c24b926

Please sign in to comment.