[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake-mobile/master] Handled Invalid STUD URL



commit fba786cd9c4d8f35f22b277228f2757eebc34dda
Author: Hashik Donthineni <HashikDonthineni@xxxxxxxxx>
Date:   Tue Jul 7 22:07:58 2020 +0530

    Handled Invalid STUD URL
---
 .../main/java/org/torproject/snowflake/MyPersistentService.java    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/app/src/main/java/org/torproject/snowflake/MyPersistentService.java b/app/src/main/java/org/torproject/snowflake/MyPersistentService.java
index 2e98501..62f1d3f 100644
--- a/app/src/main/java/org/torproject/snowflake/MyPersistentService.java
+++ b/app/src/main/java/org/torproject/snowflake/MyPersistentService.java
@@ -417,8 +417,15 @@ public class MyPersistentService extends Service {
      * @param t
      */
     public void offerRequestFailure(Throwable t) {
+        if (t instanceof NullPointerException) {
+            //We don't want to resend the request for offer unless user gives a valid URL and restarts the service.
+            updateNotification("Invalid STUN server assigned. Please verify and restart.");
+            closeConnections(false);
+            return;
+        }
         updateNotification("Request failed, retrying...");
         Log.d(TAG, "requestFailure: " + t.getMessage());
+        t.printStackTrace();
         isConnectionAlive = false;
     }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits