return 0;
}
+static void
+sk_err_hook(sock *s, int e)
+{
+ s->err_hook(s, e);
+}
+
static int
sk_connect(sock *s)
{
if (fd < 0)
{
if ((errno != EINTR) && (errno != EAGAIN))
- s->err_hook(s, errno);
+ sk_err_hook(s, errno);
return 0;
}
{
reset_tx_buffer(s);
/* EPIPE is just a connection close notification during TX */
- s->err_hook(s, (errno != EPIPE) ? errno : 0);
+ sk_err_hook(s, (errno != EPIPE) ? errno : 0);
return -1;
}
return 0;
if (e < 0)
{
s->err = ssh_get_error(s->ssh->session);
- s->err_hook(s, ssh_get_error_code(s->ssh->session));
+ sk_err_hook(s, ssh_get_error_code(s->ssh->session));
reset_tx_buffer(s);
/* EPIPE is just a connection close notification during TX */
- s->err_hook(s, (errno != EPIPE) ? errno : 0);
+ sk_err_hook(s, (errno != EPIPE) ? errno : 0);
return -1;
}
s->ttx += e;
if (errno != EINTR && errno != EAGAIN)
{
reset_tx_buffer(s);
- s->err_hook(s, errno);
+ sk_err_hook(s, errno);
return -1;
}
if (ssh_channel_is_eof(s->ssh->channel) != 0)
{
/* The remote side is closing the connection */
- s->err_hook(s, 0);
+ sk_err_hook(s, 0);
return 0;
}
if (ssh_channel_is_eof(s->ssh->channel) != 0)
{
/* The remote side is closing the connection */
- s->err_hook(s, 0);
+ sk_err_hook(s, 0);
}
}
else
{
s->err = ssh_get_error(s->ssh->session);
- s->err_hook(s, ssh_get_error_code(s->ssh->session));
+ sk_err_hook(s, ssh_get_error_code(s->ssh->session));
}
return 0; /* No data is available on the socket */
if (c < 0)
{
if (errno != EINTR && errno != EAGAIN)
- s->err_hook(s, errno);
+ sk_err_hook(s, errno);
else if (errno == EAGAIN && !(revents & POLLIN))
{
log(L_ERR "Got EAGAIN from read when revents=%x (without POLLIN)", revents);
- s->err_hook(s, 0);
+ sk_err_hook(s, 0);
}
}
else if (!c)
- s->err_hook(s, 0);
+ sk_err_hook(s, 0);
else
{
s->rpos += c;
if (e < 0)
{
if (errno != EINTR && errno != EAGAIN)
- s->err_hook(s, errno);
+ sk_err_hook(s, errno);
return 0;
}
if (sk_connect(s) >= 0 || errno == EISCONN)
sk_tcp_connected(s);
else if (errno != EINTR && errno != EAGAIN && errno != EINPROGRESS)
- s->err_hook(s, errno);
+ sk_err_hook(s, errno);
return 0;
}
case SSH_ERROR:
s->err = ssh_get_error(s->ssh->session);
- s->err_hook(s, ssh_get_error_code(s->ssh->session));
+ sk_err_hook(s, ssh_get_error_code(s->ssh->session));
break;
}
return 0;
se = 0;
}
- s->err_hook(s, se);
+ sk_err_hook(s, se);
tmp_flush();
}