#include "ircd.h"
#include "ircd_alloc.h"
#include "ircd_osdep.h"
+#include "ircd_reply.h"
#include "ircd_string.h"
#include "numeric.h"
#include "s_bsd.h"
}
else
flags[1] = '\0';
-
- sendto_one(sptr, rpl_str(RPL_STATSPLINE),
- me.name, sptr->name, listener->port,
- listener->ref_count, flags,
- (listener->active) ? "active" : "disabled");
+
+ send_reply(sptr, RPL_STATSPLINE, listener->port, listener->ref_count,
+ flags, (listener->active) ? "active" : "disabled");
if (--count == 0)
break;
}
assert(0 != listener);
- if (EmptyString(mask) && strcmp(mask,"*")!=0) {
+ if (EmptyString(mask) || 0 == strcmp(mask, "*")) {
listener->mask.s_addr = 0;
return;
}
* point, just assume that connections cannot
* be accepted until some old is closed first.
*/
- if (-1 == (fd = accept(listener->fd, (struct sockaddr*) &addr, &addrlen)))
+ if (-1 == (fd = accept(listener->fd, (struct sockaddr*) &addr, &addrlen))) {
+ /* Lotsa admins seem to have problems with not giving enough file descriptors
+ * to their server so we'll add a generic warning mechanism here. If it
+ * turns out too many messages are generated for meaningless reasons we
+ * can filter them back.
+ */
+ sendto_op_mask(SNO_TCPCOMMON,"Unable to accept connection: %s", strerror(errno));
return;
+ }
/*
* check for connection limit
*/