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

cohosh at torproject.org cohosh at torproject.org
Fri Jul 10 16:27:27 UTC 2020


commit fba786cd9c4d8f35f22b277228f2757eebc34dda
Author: Hashik Donthineni <HashikDonthineni at gmail.com>
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;
     }
 





More information about the tor-commits mailing list