the accepting new connection does not need to stop if bad one appears.
/* get free PgSocket */
client = obj_alloc(client_cache);
if (!client) {
+ log_warning("cannot allocate client struct");
safe_close(sock);
return NULL;
}
change_client_state(client, CL_LOGIN);
- if (cf_log_connections)
- slog_debug(client, "got connection attempt");
res = sbuf_accept(&client->sbuf, sock, is_unix);
- if (!res)
+ if (!res) {
+ if (cf_log_connections)
+ slog_debug(client, "failed connection attempt");
return NULL;
-
+ }
return client;
}
client = accept_client(fd, &addr.in, false);
}
- if (!client) {
- log_warning("P: no mem for client struct");
- return;
- }
-
/*
* there may be several clients waiting,
* avoid context switch by looping
err = getsockopt(sbuf->sock, SOL_SOCKET, SO_ERROR, (void*)&optval, &optlen);
if (err < 0) {
- log_error("sbuf_after_connect_check: getsockopt: %s",
+ log_debug("sbuf_after_connect_check: getsockopt: %s",
strerror(errno));
return false;
}
if (optval != 0) {
- log_error("sbuf_after_connect_check: pending error: %s",
+ log_debug("sbuf_after_connect_check: pending error: %s",
strerror(optval));
return false;
}