Skip to content

Commit

Permalink
关闭前一个响应
Browse files Browse the repository at this point in the history
解决 java.lang.IllegalStateException: cannot make a new request because the previous response is still open: please call response.close()
  • Loading branch information
hlyzhot authored and TonyJiangWJ committed Mar 11, 2024
1 parent c059556 commit 750c9ac
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public class MutableOkHttp extends OkHttpClient {
do {
boolean succeed;
try {
if (response != null) {
response.close();
}
response = chain.proceed(request);
succeed = response.isSuccessful();
} catch (SocketTimeoutException e) {
Expand Down

0 comments on commit 750c9ac

Please sign in to comment.