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

Loading…
Cancel
Save