]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Mon May 19 11:53:23 EDT 2008 Pekka Pessi <first.last@nokia.com>
authorMichael Jerris <mike@jerris.com>
Sun, 25 May 2008 03:03:58 +0000 (03:03 +0000)
committerMichael Jerris <mike@jerris.com>
Sun, 25 May 2008 03:03:58 +0000 (03:03 +0000)
  * tport_type_tcp.c: report EPIPE when transport gets closed after ping-pong timeout

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8590 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c
libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c

index e2ccbb59553fdaa6d1dbe6961721c6acbb5b166f..d53bbb6f02c5e4231a5fe8d7fac9b4f5d25ffa3d 100644 (file)
@@ -1 +1 @@
-Wed May 21 00:25:55 CEST 2008
+Sat May 24 23:03:50 EDT 2008
index 723988f945fd03e8d00d5743a904eda0f5e7d76a..5bd06959d46c8a7e9be58c77fd4c7d1eaeb71347 100644 (file)
@@ -226,7 +226,7 @@ tag_typedef_t tptag_pingpong = UINTTAG_TYPEDEF(pingpong);
  * If true, respond with PONG to PING. Default value is 0 (false).
  *
  * If set, the ping-pong protocol is used on TCP connections. If a ping (at
- * least 4 whitespace characters) is received within messages, a pong
+ * least 4 whitespace characters) is received between messages, a pong
  * (CR-LF) is sent in response.
  *
  * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
index 26ccf4661a6409d447a8f4ca9d38a1fde174e3e2..38b06aa6177e45047e83484cc17431d9b0e8aa73 100644 (file)
@@ -277,7 +277,8 @@ int tport_recv_stream(tport_t *self)
     if (n <= 0)
       return (int)n;
 
-    SU_DEBUG_7(("%s(%p): received keepalive\n", __func__, (void *)self));
+    SU_DEBUG_7(("%s(%p): received keepalive (total %u)\n", __func__,
+               (void *)self, self->tp_ping));
 
     N -= n, self->tp_ping += n;
 
@@ -449,7 +450,9 @@ void tport_keepalive_timer(tport_t *self, su_time_t now)
                  __func__, (void *)self,
                  "closing connection", TPN_ARGS(self->tp_name), 
                  " because of PONG timeout"));
-      tport_close(self);
+      tport_error_report(self, EPIPE, NULL);
+      if (!self->tp_closed)
+       tport_close(self);
       return;
     }
   }