Mholloway has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/294306

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 fix
in OkHttp.  Note that the underlying bug/quirk in nginx is still
in place, so our HTTP/2 connections will still be failing and we'll be
falling back to HTTP/1.1 until our nginx is upgraded to 1.11.[2]

Bug: T134817

[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.

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


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/06/294306/1

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: newchange
Gerrit-Change-Id: I50de05e1de4840f181a4d94360ecad1db41ecd08
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mholloway <[email protected]>

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

Reply via email to