Commit 8a7ff10f authored by Pekka Pessi's avatar Pekka Pessi
Browse files

tport_type_tcp.c: report EPIPE when transport gets closed after ping-pong timeout

darcs-hash:20080519155323-db55f-e4cbaae7b342c564b3e805df95a1dc52dfe85e93.gz
parent bb3c721d
...@@ -226,7 +226,7 @@ tag_typedef_t tptag_pingpong = UINTTAG_TYPEDEF(pingpong); ...@@ -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 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 * 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. * (CR-LF) is sent in response.
* *
* Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(), * Use with tport_tcreate(), tport_tbind(), tport_set_params(), nua_create(),
......
...@@ -277,7 +277,8 @@ int tport_recv_stream(tport_t *self) ...@@ -277,7 +277,8 @@ int tport_recv_stream(tport_t *self)
if (n <= 0) if (n <= 0)
return (int)n; 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; N -= n, self->tp_ping += n;
...@@ -449,7 +450,9 @@ void tport_keepalive_timer(tport_t *self, su_time_t now) ...@@ -449,7 +450,9 @@ void tport_keepalive_timer(tport_t *self, su_time_t now)
__func__, (void *)self, __func__, (void *)self,
"closing connection", TPN_ARGS(self->tp_name), "closing connection", TPN_ARGS(self->tp_name),
" because of PONG timeout")); " because of PONG timeout"));
tport_close(self); tport_error_report(self, EPIPE, NULL);
if (!self->tp_closed)
tport_close(self);
return; return;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment