aboutsummaryrefslogtreecommitdiff
path: root/src/conn.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-07-04 00:28:30 -0400
committerDeterminant <[email protected]>2019-07-04 00:28:30 -0400
commit69a9bed21f18728483320e88530045180796e2ac (patch)
tree67aa3c133ba514b55934de638cea3bca38f71d0a /src/conn.cpp
parent2ef9c99438e5c87651332f47c98da8d397b030e3 (diff)
improve dispatcher shutdown
Diffstat (limited to 'src/conn.cpp')
-rw-r--r--src/conn.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/conn.cpp b/src/conn.cpp
index 13486ee..5e663b6 100644
--- a/src/conn.cpp
+++ b/src/conn.cpp
@@ -273,15 +273,19 @@ void ConnPool::disp_terminate(const conn_t &conn) {
});
}
-void ConnPool::accept_client(int fd, int) {
+void ConnPool::accept_client(int fd, int events) {
int client_fd;
struct sockaddr client_addr;
try {
socklen_t addr_size = sizeof(struct sockaddr_in);
if ((client_fd = accept(fd, &client_addr, &addr_size)) < 0)
+ {
+ ev_listen.del();
throw ConnPoolError(SALTI_ERROR_ACCEPT, errno);
+ }
else
{
+ SALTICIDAE_LOG_INFO("%d\n", events);
int one = 1;
if (setsockopt(client_fd, SOL_TCP, TCP_NODELAY, (const char *)&one, sizeof(one)) < 0)
throw ConnPoolError(SALTI_ERROR_ACCEPT, errno);