Commit f826cbd7 authored by Pekka Pessi's avatar Pekka Pessi

tport_type_tcp.c: remove redundant check from tport_tcp_ping()

MeeGo Coverity issue CID#7509
parent cb0e67ef
......@@ -480,15 +480,7 @@ int tport_tcp_ping(tport_t *self, su_time_t now)
return 0;
n = send(self->tp_socket, "\r\n\r\n", 4, 0);
if (n > 0)
self->tp_ktime = now;
if (n == 4) {
if (self->tp_ptime.tv_sec == 0)
self->tp_ptime = now;
}
else if (n == -1) {
if (n == -1) {
int error = su_errno();
why = " failed";
......@@ -501,11 +493,19 @@ int tport_tcp_ping(tport_t *self, su_time_t now)
return -1;
}
if (n > 0)
self->tp_ktime = now;
if (n == 4) {
if (self->tp_ptime.tv_sec == 0)
self->tp_ptime = now;
}
SU_DEBUG_7(("%s(%p): %s to " TPN_FORMAT "%s\n",
__func__, (void *)self,
"sending PING", TPN_ARGS(self->tp_name), why));
return n == -1 ? -1 : 0;
return 0;
}
/** Send pong */
......
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