Skip to content

Commit

Permalink
Merge pull request square#1224 from square/jw/copy
Browse files Browse the repository at this point in the history
Use native Okio copy for retrying.
  • Loading branch information
JakeWharton committed Jan 3, 2015
2 parents f130793 + 96dec38 commit 5123b3d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ public long contentLength() throws IOException {
}

public void writeToSocket(Sink socketOut) throws IOException {
// Clone the content; otherwise we won't have data to retry.
Buffer buffer = content.clone();
// Copy the content; otherwise we won't have data to retry.
Buffer buffer = new Buffer();
content.copyTo(buffer, 0, content.size());
socketOut.write(buffer, buffer.size());
}
}

0 comments on commit 5123b3d

Please sign in to comment.