mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-10 09:43:12 +02:00
Index: Changes
=================================================================== RCS file: /home/cmunk/ircsystems/cvsroot/unreal/Changes,v retrieving revision 1.1.1.1.2.1.2.1.2.2403 diff -u -r1.1.1.1.2.1.2.1.2.2403 Changes --- Changes 15 May 2007 00:38:07 -0000 1.1.1.1.2.1.2.1.2.2403 +++ Changes 17 May 2007 09:56:36 -0000 @@ -1702,3 +1702,8 @@ concept, so please tell me if some OS'es break bigtime. - #003075 - reported by aquanight regarding log block failing silently for non-creatable log files. Now fails with an error message. +- Now using #0003028, with more intelligent accept() handling. The IRCd + will now attempt to accept() up to LISTEN_SIZE (possibly saving CPU + through this under load, and speeding up connection). +- IRCd now also sets the &me fd as being non blocking (wasn't before, that + was odd..)
This commit is contained in:
@@ -1702,3 +1702,8 @@ MOTDs
|
||||
concept, so please tell me if some OS'es break bigtime.
|
||||
- #003075 - reported by aquanight regarding log block failing silently
|
||||
for non-creatable log files. Now fails with an error message.
|
||||
- Now using #0003028, with more intelligent accept() handling. The IRCd
|
||||
will now attempt to accept() up to LISTEN_SIZE (possibly saving CPU
|
||||
through this under load, and speeding up connection).
|
||||
- IRCd now also sets the &me fd as being non blocking (wasn't before, that
|
||||
was odd..)
|
||||
|
||||
@@ -1496,11 +1496,13 @@ int InitwIRCD(int argc, char *argv[])
|
||||
#ifndef NEW_IO
|
||||
if (inetport(&me, conf_listen->ip, portnum))
|
||||
exit(1);
|
||||
set_non_blocking(me.fd, &me);
|
||||
#else /* ifndef NEW_IO */
|
||||
#endif /* ifndef NEW_IO */
|
||||
conf_listen->options |= LISTENER_BOUND;
|
||||
me.umodes = conf_listen->options;
|
||||
conf_listen->listener = &me;
|
||||
|
||||
run_configuration();
|
||||
botmotd = (aMotd *) read_file(BPATH, NULL);
|
||||
rules = (aMotd *) read_file(RPATH, NULL);
|
||||
|
||||
+20
-16
@@ -1440,7 +1440,7 @@ int read_message(time_t delay, fdlist * listp)
|
||||
#else
|
||||
fd_set read_set, write_set, excpt_set;
|
||||
#endif
|
||||
int j;
|
||||
int j,k;
|
||||
time_t delay2 = delay, now;
|
||||
int res, length, fd, i;
|
||||
int auth = 0;
|
||||
@@ -1663,20 +1663,22 @@ int read_message(time_t delay, fdlist * listp)
|
||||
** point, just assume that connections cannot
|
||||
** be accepted until some old is closed first.
|
||||
*/
|
||||
if ((fd = accept(cptr->fd, NULL, NULL)) < 0)
|
||||
for (k = 0; k < LISTEN_SIZE; k++)
|
||||
{
|
||||
if ((fd = accept(cptr->fd, NULL, NULL)) < 0)
|
||||
{
|
||||
if ((ERRNO != P_EWOULDBLOCK)
|
||||
&& (ERRNO != P_ECONNABORTED))
|
||||
report_baderror
|
||||
("Cannot accept connections %s:%s",
|
||||
cptr);
|
||||
break;
|
||||
}
|
||||
ircstp->is_ac++;
|
||||
if (++OpenFiles >= MAXCLIENTS)
|
||||
{
|
||||
ircstp->is_ref++;
|
||||
if (last_allinuse < TStime() - 15)
|
||||
}
|
||||
ircstp->is_ac++;
|
||||
if (++OpenFiles >= MAXCLIENTS)
|
||||
{
|
||||
ircstp->is_ref++;
|
||||
if (last_allinuse < TStime() - 15)
|
||||
{
|
||||
sendto_realops
|
||||
("All connections in use. (%s)",
|
||||
@@ -1694,15 +1696,17 @@ int read_message(time_t delay, fdlist * listp)
|
||||
CLOSE_SOCK(fd);
|
||||
--OpenFiles;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* Use of add_connection (which never fails :) meLazy
|
||||
*/
|
||||
(void)add_connection(cptr, fd);
|
||||
nextping = TStime();
|
||||
if (!cptr->listener)
|
||||
}
|
||||
/*
|
||||
* Use of add_connection (which never fails :) meLazy
|
||||
*/
|
||||
(void)add_connection(cptr, fd);
|
||||
}
|
||||
nextping = TStime();
|
||||
if (!cptr->listener)
|
||||
cptr->listener = &me;
|
||||
}
|
||||
|
||||
}
|
||||
#ifndef NO_FDLIST
|
||||
for (i = listp->entry[j = 1]; (j <= listp->last_entry);
|
||||
i = listp->entry[++j])
|
||||
|
||||
Reference in New Issue
Block a user