[tor-commits] [snowflake-mobile/master] Handled connection termination on data channel closed event

cohosh at torproject.org cohosh at torproject.org
Mon Jun 22 14:56:17 UTC 2020


commit ee8ca17a915e83f09fe75650291d69f2b9a695e4
Author: Hashik Donthineni <HashikDonthineni at gmail.com>
Date:   Fri Jun 19 17:15:33 2020 +0530

    Handled connection termination on data channel closed event
---
 app/src/main/java/org/torproject/snowflake/MyPersistentService.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/src/main/java/org/torproject/snowflake/MyPersistentService.java b/app/src/main/java/org/torproject/snowflake/MyPersistentService.java
index b888700..d98c9ca 100644
--- a/app/src/main/java/org/torproject/snowflake/MyPersistentService.java
+++ b/app/src/main/java/org/torproject/snowflake/MyPersistentService.java
@@ -297,8 +297,12 @@ public class MyPersistentService extends Service {
             @Override
             public void dataChannelStateChange(final DataChannel.State STATE) {
                 Log.d(TAG, "dataChannelStateChange: Data Channel State: " + STATE);
+
                 if (STATE == DataChannel.State.OPEN) {
                     updateNotification("Connection Established. Serving one client.");
+                } else if (STATE == DataChannel.State.CLOSED) {
+                    updateNotification("Connection is closed. Resending offer...");
+                    closeConnectionAndResend();
                 }
             }
         });



More information about the tor-commits mailing list