jenkins-bot has submitted this change and it was merged.

Change subject: Remove custom protocol list from OkHttpConnectionFactory
......................................................................


Remove custom protocol list from OkHttpConnectionFactory

OkHttp will recover from REFUSED_STREAM errors in HTTP/2 as of v3.3.0.[1]

This patch removes the workaround we had in place while awaiting the
fixes in nginx and OkHttp so that we can benefit from HTTP/2.

[1] https://github.com/square/okhttp/blob/master/CHANGELOG.md

[2] https://nginx.org/en/CHANGES

The relevent change is:

*) Change: HTTP/2 clients can now start sending request body
   immediately; the "http2_body_preread_size" directive controls size of
   the buffer used before nginx will start reading client request body.

Bug: T134817
Change-Id: I50de05e1de4840f181a4d94360ecad1db41ecd08
---
M app/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
1 file changed, 0 insertions(+), 11 deletions(-)

Approvals:
  BearND: Looks good to me, but someone else must approve
  Niedzielski: Looks good to me, approved
  BBlack: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/app/src/main/java/org/wikipedia/OkHttpConnectionFactory.java 
b/app/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
index e73dcff..8a18c10 100644
--- a/app/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
+++ b/app/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
@@ -11,15 +11,12 @@
 import java.net.HttpURLConnection;
 import java.net.Proxy;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
 
 import okhttp3.Cache;
 import okhttp3.CookieJar;
 import okhttp3.JavaNetCookieJar;
 import okhttp3.OkHttpClient;
 import okhttp3.OkUrlFactory;
-import okhttp3.Protocol;
 import okhttp3.logging.HttpLoggingInterceptor;
 
 public class OkHttpConnectionFactory implements HttpRequest.ConnectionFactory {
@@ -44,13 +41,6 @@
     }
 
     public static OkHttpClient.Builder createClient(@NonNull Context context) {
-        // Create a custom set of protocols that excludes HTTP/2, since OkHttp 
doesn't play
-        // nicely with nginx over HTTP/2.
-        // TODO: Remove when https://github.com/square/okhttp/issues/2543 is 
fixed.
-        List<Protocol> protocolList = new ArrayList<>();
-        protocolList.add(Protocol.SPDY_3);
-        protocolList.add(Protocol.HTTP_1_1);
-
         SharedPreferenceCookieManager cookieManager
                 = ((WikipediaApp) 
context.getApplicationContext()).getCookieManager();
         // TODO: consider using okhttp3.CookieJar implementation instead of 
JavaNetCookieJar wrapper
@@ -63,7 +53,6 @@
         return new OkHttpClient.Builder()
                 .cookieJar(cookieJar)
                 .cache(HTTP_CACHE)
-                .protocols(protocolList)
                 .addInterceptor(loggingInterceptor);
     }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/294306
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I50de05e1de4840f181a4d94360ecad1db41ecd08
Gerrit-PatchSet: 4
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mholloway <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: BearND <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Dbrant <[email protected]>
Gerrit-Reviewer: Mholloway <[email protected]>
Gerrit-Reviewer: Niedzielski <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to