Skip to content

Commit

Permalink
Debugging prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Brandon Wiley committed Oct 1, 2020
1 parent 44bee7f commit 25152d0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/TransmissionLinux/Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,32 @@ public class Connection

public func read(size: Int) -> Data?
{
print("1")
if size == 0
{
return nil
}

var data = Data()

print("2")

do
{
let bytesRead = try self.socket.read(into: &data)
print("3")
buffer.append(data[0..<bytesRead])
print("4")

guard size <= buffer.count else
{
return nil
}
print("5")

let result = buffer[0..<size]
print("6")
buffer = buffer[size..<buffer.count]
print("7")

return result
}
Expand Down

0 comments on commit 25152d0

Please sign in to comment.