Browse Source

Send a reconnect message on failure to passthrough send, assuming a connection has failed.

master
Con Kolivas 9 years ago
parent
commit
1932659baa
  1. 7
      src/generator.c

7
src/generator.c

@ -1419,7 +1419,7 @@ static void *passthrough_recv(void *arg)
return NULL;
}
static void passthrough_send(ckpool_t __maybe_unused *ckp, pass_msg_t *pm)
static void passthrough_send(ckpool_t *ckp, pass_msg_t *pm)
{
int len, sent;
@ -1427,8 +1427,9 @@ static void passthrough_send(ckpool_t __maybe_unused *ckp, pass_msg_t *pm)
len = strlen(pm->msg);
sent = write_socket(pm->cs->fd, pm->msg, len);
if (sent != len) {
/* FIXME: Do something about this? */
LOGWARNING("Failed to passthrough %d bytes of message %s", len, pm->msg);
LOGWARNING("Failed to passthrough %d bytes of message %s, attempting reconnect",
len, pm->msg);
send_proc(ckp->generator, "reconnect");
}
free(pm->msg);
free(pm);

Loading…
Cancel
Save