Fix bug in delayed connection handling, 2nd try

personal/stbuehler/wip
Stefan Bühler 12 years ago
parent 318b7bf041
commit 366d00328c
  1. 3
      src/common/memcached.c
  2. 3
      src/modules/mod_fastcgi.c
  3. 3
      src/modules/mod_proxy.c
  4. 3
      src/modules/mod_scgi.c

@ -295,10 +295,11 @@ static void memcached_connect(liMemcachedCon *con) {
case EINPROGRESS:
case EALREADY:
case EINTR:
case EISCONN:
memcached_start_io(con);
li_ev_io_add_events(con->loop, &con->con_watcher, EV_READ | EV_WRITE);
break;
case EISCONN:
break;
default:
g_clear_error(&con->err);
g_set_error(&con->err, LI_MEMCACHED_ERROR, LI_MEMCACHED_CONNECTION, "Couldn't connect to '%s': %s",

@ -683,13 +683,14 @@ static liHandlerResult fastcgi_statemachine(liVRequest *vr, fastcgi_connection *
case EINPROGRESS:
case EALREADY:
case EINTR:
case EISCONN:
fcon->state = FS_CONNECTING;
return LI_HANDLER_GO_ON;
case EAGAIN: /* backend overloaded */
fastcgi_close(vr, p);
li_vrequest_backend_overloaded(vr);
return LI_HANDLER_GO_ON;
case EISCONN:
break;
default:
if (errno != g_atomic_int_get(&fcon->ctx->last_errno)) {
g_atomic_int_set(&fcon->ctx->last_errno, errno);

@ -330,13 +330,14 @@ static liHandlerResult proxy_statemachine(liVRequest *vr, proxy_connection *pcon
case EINPROGRESS:
case EALREADY:
case EINTR:
case EISCONN:
pcon->state = SS_CONNECTING;
return LI_HANDLER_GO_ON;
case EAGAIN: /* backend overloaded */
proxy_close(vr, p);
li_vrequest_backend_overloaded(vr);
return LI_HANDLER_GO_ON;
case EISCONN:
break;
default:
VR_ERROR(vr, "Couldn't connect to '%s': %s",
li_sockaddr_to_string(pcon->ctx->socket, vr->wrk->tmp_str, TRUE)->str,

@ -436,13 +436,14 @@ static liHandlerResult scgi_statemachine(liVRequest *vr, scgi_connection *scon)
case EINPROGRESS:
case EALREADY:
case EINTR:
case EISCONN:
scon->state = SS_CONNECTING;
return LI_HANDLER_GO_ON;
case EAGAIN: /* backend overloaded */
scgi_close(vr, p);
li_vrequest_backend_overloaded(vr);
return LI_HANDLER_GO_ON;
case EISCONN:
break;
default:
VR_ERROR(vr, "Couldn't connect to '%s': %s",
li_sockaddr_to_string(scon->ctx->socket, vr->wrk->tmp_str, TRUE)->str,

Loading…
Cancel
Save