We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentd218776 commitccce974Copy full SHA for ccce974
contrib/arbiter/src/server.c
@@ -418,8 +418,15 @@ static bool server_accept(server_t server) {
418
shout("failed to accept a connection: %s\n",strerror(errno));
419
return false;
420
}
421
-debug("a new connection accepted\n");
+debug("a new connectionfd=%daccepted\n",fd);
422
423
+if (!server->enabled) {
424
+shout("server disabled, disconnecting the accepted connection fd=%d\n",fd);
425
+// FIXME: redirect instead of disconnecting
426
+close(fd);
427
+return false;
428
+}
429
+
430
s=server->free_chain;
431
if (s==NULL) {
432
s=malloc(sizeof(stream_data_t));
@@ -430,13 +437,6 @@ static bool server_accept(server_t server) {
437
s->next=server->used_chain;
438
server->used_chain=s;
439
433
-if (!server->enabled) {
434
-shout("server disabled, disconnecting the accepted connection\n");
435
-// FIXME: redirect instead of disconnecting
436
-close(fd);
-return false;
-}
-
440
stream_init(s,fd);
441
442
returnserver_add_socket(server,fd,s);