Browse Source

Remove epoll entry when closing socket to reconnect in connect_proxy

master
Con Kolivas 9 years ago
parent
commit
542c4f457b
  1. 4
      src/generator.c

4
src/generator.c

@ -435,8 +435,10 @@ static bool send_json_msg(connsock_t *cs, const json_t *json_msg)
static bool connect_proxy(ckpool_t *ckp, connsock_t *cs, proxy_instance_t *proxy) static bool connect_proxy(ckpool_t *ckp, connsock_t *cs, proxy_instance_t *proxy)
{ {
if (cs->fd > 0) if (cs->fd > 0) {
epoll_ctl(proxy->epfd, EPOLL_CTL_DEL, cs->fd, NULL);
Close(cs->fd); Close(cs->fd);
}
cs->fd = connect_socket(cs->url, cs->port); cs->fd = connect_socket(cs->url, cs->port);
if (cs->fd < 0) { if (cs->fd < 0) {
LOGINFO("Failed to connect socket to %s:%s in connect_proxy", LOGINFO("Failed to connect socket to %s:%s in connect_proxy",

Loading…
Cancel
Save