Browse Source

Handle upstream pools sending messages and then closing sockets immediately afterwards (eg after a redirect.)

master
Con Kolivas 8 years ago
parent
commit
44d6029e54
  1. 11
      src/generator.c

11
src/generator.c

@ -2100,12 +2100,15 @@ static void *proxy_recv(void *arg)
/* Serialise messages from here once we have a cs by /* Serialise messages from here once we have a cs by
* holding the semaphore. */ * holding the semaphore. */
cksem_wait(&cs->sem); cksem_wait(&cs->sem);
if (event.events & (EPOLLHUP | EPOLLERR | EPOLLRDHUP)) /* Process any messages before checking for errors in
ret = -1; * case a message is sent and then the socket
else { * immediately closed.
*/
if (event.events & EPOLLIN) {
timeout = 30; timeout = 30;
ret = read_socket_line(cs, &timeout); ret = read_socket_line(cs, &timeout);
} } else if (event.events & (EPOLLHUP | EPOLLERR | EPOLLRDHUP))
ret = -1;
} }
if (ret < 1) { if (ret < 1) {
LOGNOTICE("Proxy %d:%d %s failed to epoll/read_socket_line in proxy_recv", LOGNOTICE("Proxy %d:%d %s failed to epoll/read_socket_line in proxy_recv",

Loading…
Cancel
Save