Skip to content

Commit 89d03e0

Browse files
committed
Adapting to the latest OKHttp (3.14.0) (#45)
2 parents 5763c68 + d2bd926 commit 89d03e0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
'MIN_SDK' : 14,
77
'TARGET_SDK' : 28,
88
'SUPPORT_LIB' : '2.0.0-rc01',
9-
'OKHTTP' : '3.9.0'
9+
'OKHTTP' : '3.14.0'
1010
]
1111

1212
repositories {

pandora-core/src/main/java/tech/linjiang/pandora/network/okhttp3/internal/huc/StreamedRequestBody.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package tech.linjiang.pandora.network.okhttp3.internal.huc;
1717

1818
import java.io.IOException;
19-
import okhttp3.internal.http.UnrepeatableRequestBody;
2019
import okio.Buffer;
2120
import okio.BufferedSink;
2221
import okio.Okio;
@@ -26,7 +25,7 @@
2625
* This request body streams bytes from an application thread to an OkHttp dispatcher thread via a
2726
* pipe. Because the data is not buffered it can only be transmitted once.
2827
*/
29-
final class StreamedRequestBody extends OutputStreamRequestBody implements UnrepeatableRequestBody {
28+
final class StreamedRequestBody extends OutputStreamRequestBody {
3029
private final Pipe pipe = new Pipe(8192);
3130

3231
StreamedRequestBody(long expectedContentLength) {
@@ -39,4 +38,9 @@ final class StreamedRequestBody extends OutputStreamRequestBody implements Unrep
3938
sink.write(buffer, buffer.size());
4039
}
4140
}
41+
42+
@Override
43+
public boolean isOneShot() {
44+
return true;
45+
}
4246
}

0 commit comments

Comments
 (0)