File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
firebase-config/src/main/java/com/google/firebase/remoteconfig/internal Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -313,8 +313,7 @@ private boolean isStatusCodeRetryable(int statusCode) {
313
313
|| statusCode == HTTP_TOO_MANY_REQUESTS
314
314
|| statusCode == HttpURLConnection .HTTP_BAD_GATEWAY
315
315
|| statusCode == HttpURLConnection .HTTP_UNAVAILABLE
316
- || statusCode == HttpURLConnection .HTTP_GATEWAY_TIMEOUT
317
- || statusCode == HttpURLConnection .HTTP_OK ;
316
+ || statusCode == HttpURLConnection .HTTP_GATEWAY_TIMEOUT ;
318
317
}
319
318
320
319
/**
@@ -330,7 +329,7 @@ public synchronized void beginRealtimeHttpStream() {
330
329
return ;
331
330
}
332
331
333
- int responseCode = 200 ;
332
+ int responseCode = 0 ;
334
333
try {
335
334
// Create the open the connection.
336
335
httpURLConnection = createRealtimeConnection ();
@@ -349,7 +348,11 @@ public synchronized void beginRealtimeHttpStream() {
349
348
Log .d (TAG , "Exception connecting to realtime stream. Retrying the connection..." );
350
349
} finally {
351
350
closeRealtimeHttpStream ();
352
- if (isStatusCodeRetryable (responseCode )) {
351
+
352
+ // If responseCode is 0 then no connection was made to server and the SDK should still retry.
353
+ if (responseCode == 0
354
+ || responseCode == HttpURLConnection .HTTP_OK
355
+ || isStatusCodeRetryable (responseCode )) {
353
356
retryHTTPConnection ();
354
357
} else {
355
358
propagateErrors (
You can’t perform that action at this time.
0 commit comments