#define INADDR_NONE ((unsigned int) 0xffffffff)
#endif
+int tos_server = 0x08; // Low delay
+int tos_client = 0x08; // Low delay
+
struct Listener* ListenerPollList = 0;
static struct Listener* make_listener(int port, struct in_addr addr)
{
static char buf[HOSTLEN + PORTNAMELEN + 4];
assert(0 != listener);
- sprintf_irc(buf, "%s:%u", me.name, listener->port);
+ sprintf_irc(buf, "%s:%u", cli_name(&me), listener->port);
return buf;
}
close(fd);
return 0;
}
+ /*
+ * Set the TOS bits - this is nonfatal if it doesn't stick.
+ */
+ if (!os_set_tos(fd,(listener->server) ? tos_server : tos_client)) {
+ report_error(TOS_ERROR_MSG, get_listener_name(listener), errno);
+ }
listener->fd = fd;
return 1;
assert(0 != listener);
- if (EmptyString(mask) && strcmp(mask,"*")!=0) {
+ if (EmptyString(mask) || 0 == strcmp(mask, "*")) {
listener->mask.s_addr = 0;
return;
}
* be accepted until some old is closed first.
*/
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_opmask_butone(0, SNO_TCPCOMMON, "Unable to accept connection: %m");
return;
}
/*