Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,21 @@ public long contentLength() throws IOException {

@Override
public void writeTo(@Nonnull BufferedSink sink) throws IOException {
long contentLength = contentLength();
if (contentLength > 0) {
requestInfo.content.mark((int) contentLength);
}
sink.writeAll(Okio.source(requestInfo.content));
if (!isOneShot()) {
requestInfo.content.reset();
try {
requestInfo.content.reset();
} catch (Exception ex) {
spanForAttributes.recordException(ex);
// we don't want to fail the request if reset() fails
// reset() was a measure to prevent draining the request
// body by an interceptor before
// the final network request
}
}
}
};
Expand Down
Loading