We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5817a88 commit 328fdbbCopy full SHA for 328fdbb
1 file changed
src/server/WFServer.cc
@@ -142,18 +142,15 @@ int WFServerBase::create_listen_fd()
142
143
WFConnection *WFServerBase::new_connection(int accept_fd)
144
{
145
- if (++this->conn_count <= this->params.max_connections ||
146
- this->drain(1) == 1)
+ if (++this->conn_count > this->params.max_connections &&
+ this->drain(1) <= 0)
147
148
- int reuse = 1;
149
- setsockopt(accept_fd, SOL_SOCKET, SO_REUSEADDR,
150
- (const char *)(&reuse), sizeof (int));
151
- return new WFServerConnection(&this->conn_count);
+ this->conn_count--;
+ errno = EMFILE;
+ return NULL;
152
}
153
154
- this->conn_count--;
155
- errno = EMFILE;
156
- return NULL;
+ return new WFServerConnection(&this->conn_count);
157
158
159
void WFServerBase::delete_connection(WFConnection *conn)
0 commit comments