]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[sofia-sip] Timed out or not established wss should be destroyed immediately and... 626/head
authorAndrey Volk <andywolk@gmail.com>
Sat, 9 May 2020 16:08:58 +0000 (20:08 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 11 May 2020 20:04:47 +0000 (00:04 +0400)
libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/tport/tport.c
libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c

index bbf71612f84cde23feb90782af6cea9ca327f9c7..e6af7a2165222a4ce118bb2be308a08787067d25 100644 (file)
@@ -1 +1 @@
-Thu Apr 30 14:02:03 UTC 2020
+Sat May 09 16:04:04 UTC 2020
index 9eca15f77a18dc0146985f95005f06ab5aa979c5..980df15c19594cb525e52313f34b612d220f051d 100644 (file)
@@ -2266,6 +2266,8 @@ int tport_set_secondary_timer(tport_t *self)
     return 0;
 
   if (tport_is_closed(self)) {
+
+again:
     if (self->tp_refs == 0) {
       SU_DEBUG_7(("tport(%p): set timer at %u ms because %s\n",
                                  (void *)self, 0, "zap"));
@@ -2291,9 +2293,14 @@ int tport_set_secondary_timer(tport_t *self)
     }
   }
 
-  if (self->tp_pri->pri_vtable->vtp_next_secondary_timer)
-    self->tp_pri->pri_vtable->
-      vtp_next_secondary_timer(self, &target, &why);
+  if (self->tp_pri->pri_vtable->vtp_next_secondary_timer) {
+    if (self->tp_pri->pri_vtable->
+      vtp_next_secondary_timer(self, &target, &why) == -1) {
+      if (tport_is_closed(self)) {
+        goto again;
+      }
+    }
+  }
 
   if (su_time_cmp(target, infinity)) {
     SU_DEBUG_7(("tport(%p): set timer at %ld ms because %s\n",
index 7e1dc76456d17d3ace3cd9cd98da6993646ba5d0..618ac8bd2f914ddff785dda85b19b8e3b380c089 100644 (file)
@@ -635,6 +635,8 @@ int tport_ws_next_timer(tport_t *self,
                SU_DEBUG_7(("%s(%p): %s to " TPN_FORMAT "%s\n",
                                        __func__, (void *)self,
                                        (punt == 2 ? "Timeout establishing SSL" : "Error establishing SSL"), TPN_ARGS(self->tp_name), ""));
+               if (wstp->ws.secure)
+                       return -1;
        }
 
 
@@ -646,7 +648,13 @@ int tport_ws_next_timer(tport_t *self,
 /** WS timer. */
 void tport_ws_timer(tport_t *self, su_time_t now)
 {
-  tport_recv_timeout_timer(self, now);
-  tport_keepalive_timer(self, now);
+  tport_ws_t *wstp = (tport_ws_t *)self;
+
+  if (!strcmp("wss", self->tp_protoname) && !wstp->ws.secure_established) {
+    tport_close(self);
+  } else {
+    tport_recv_timeout_timer(self, now);
+    tport_keepalive_timer(self, now);
+  }
   tport_base_timer(self, now);
 }