From 8224b039bf4b13f4c14e06bae87c5209440a3982 Mon Sep 17 00:00:00 2001 From: lishoujun Date: Mon, 8 Jun 2020 03:48:53 +0800 Subject: [PATCH] try to fix 'cannot make a new request because the previous response ... ' error (#164) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * try to fix 'cannot make a new request because the previous response is still open' when login. Co-authored-by: Stefan Schüller Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller --- .../peertube/network/AuthorizationInterceptor.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/network/AuthorizationInterceptor.java b/app/src/main/java/net/schueller/peertube/network/AuthorizationInterceptor.java index 37786c7..37ba18f 100644 --- a/app/src/main/java/net/schueller/peertube/network/AuthorizationInterceptor.java +++ b/app/src/main/java/net/schueller/peertube/network/AuthorizationInterceptor.java @@ -37,8 +37,7 @@ public class AuthorizationInterceptor implements Interceptor { public Response intercept(Chain chain) throws IOException { Session session = Session.getInstance(); - - Response mainResponse = chain.proceed(chain.request()); + Response mainResponse; Request mainRequest = chain.request(); if (session.isLoggedIn()) { @@ -49,7 +48,8 @@ public class AuthorizationInterceptor implements Interceptor { // Log.v("Authorization", "Intercept: " + session.getToken()); // build request - mainResponse = chain.proceed(builder.build()); + Request req = builder.build(); + mainResponse = chain.proceed(req); // logout on auth error if (mainResponse.code() == 401 || mainResponse.code() == 403) { @@ -57,6 +57,8 @@ public class AuthorizationInterceptor implements Interceptor { Log.v("Authorization", "Intercept: Logout forced"); } + }else{ + mainResponse = chain.proceed(chain.request()); } return mainResponse;