s->srv_error = default_srv_error;
/* Adjust some socket options */
- if ((s->listener->addr.ss_family != AF_UNIX) && unlikely(setsockopt(cfd, IPPROTO_TCP, TCP_NODELAY, (char *) &one, sizeof(one)) == -1)) {
- Alert("accept(): cannot set the socket in non blocking mode. Giving up\n");
+ if ((s->listener->addr.ss_family != AF_UNIX) &&
+ setsockopt(cfd, IPPROTO_TCP, TCP_NODELAY, (char *) &one, sizeof(one)) == -1)
goto out_delete_cfd;
- }
if (s->fe->options & PR_O_TCP_CLI_KA)
setsockopt(cfd, SOL_SOCKET, SO_KEEPALIVE, (char *) &one, sizeof(one));
struct http_txn *txn;
struct task *t;
- if (unlikely((s = pool_alloc2(pool2_session)) == NULL)) {
- Alert("out of memory in event_accept().\n");
+ if (unlikely((s = pool_alloc2(pool2_session)) == NULL))
goto out_close;
- }
/* minimum session initialization required for monitor mode below */
s->flags = 0;
LIST_ADDQ(&sessions, &s->list);
LIST_INIT(&s->back_refs);
- if (unlikely((t = task_new()) == NULL)) { /* disable this proxy for a while */
- Alert("out of memory in event_accept().\n");
+ if (unlikely((t = task_new()) == NULL))
goto out_free_session;
- }
s->term_trace = 0;
s->cli_addr = *addr;
s->store_count = 0;
/* Adjust some socket options */
- if (unlikely(fcntl(cfd, F_SETFL, O_NONBLOCK) == -1)) {
- Alert("accept(): cannot set the socket in non blocking mode. Giving up\n");
+ if (unlikely(fcntl(cfd, F_SETFL, O_NONBLOCK) == -1))
goto out_free_task;
- }
txn = &s->txn;
/* Those variables will be checked and freed if non-NULL in
}
if (unlikely(cfd >= global.maxsock)) {
- Alert("accept(): not enough free sockets. Raise -n argument. Giving up.\n");
+ send_log(p, LOG_EMERG,
+ "Proxy %s reached the configured maximum connection limit. Please check the global 'maxconn' value.\n",
+ p->id);
goto out_close;
}