projects
/
ircu2.10.12-pk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add unlimited flood priv
[ircu2.10.12-pk.git]
/
ircd
/
s_bsd.c
diff --git
a/ircd/s_bsd.c
b/ircd/s_bsd.c
index 63e9081c51da376193f3a01b9884c8e76b2da4be..cc77c7bc87f3dc68a340022234c2b2128bf18fc6 100644
(file)
--- a/
ircd/s_bsd.c
+++ b/
ircd/s_bsd.c
@@
-238,7
+238,7
@@
static int connect_inet(struct ConfItem* aconf, struct Client* cptr)
/*
* Set the TOS bits - this is nonfatal if it doesn't stick.
*/
/*
* Set the TOS bits - this is nonfatal if it doesn't stick.
*/
- if (!os_set_tos(cli_fd(cptr),
FEAT_TOS_SERVER
)) {
+ if (!os_set_tos(cli_fd(cptr),
feature_int(FEAT_TOS_SERVER)
)) {
report_error(TOS_ERROR_MSG, cli_name(cptr), errno);
}
if ((result = os_connect_nonb(cli_fd(cptr), &aconf->address)) == IO_FAILURE) {
report_error(TOS_ERROR_MSG, cli_name(cptr), errno);
}
if ((result = os_connect_nonb(cli_fd(cptr), &aconf->address)) == IO_FAILURE) {
@@
-615,11
+615,13
@@
static int read_packet(struct Client *cptr, int socket_ready)
if (length > 0 && dbuf_put(&(cli_recvQ(cptr)), readbuf, length) == 0)
return exit_client(cptr, cptr, &me, "dbuf_put fail");
if (length > 0 && dbuf_put(&(cli_recvQ(cptr)), readbuf, length) == 0)
return exit_client(cptr, cptr, &me, "dbuf_put fail");
- if (DBufLength(&(cli_recvQ(cptr))) > feature_int(FEAT_CLIENT_FLOOD))
+ int HasUnlimitFlood = HasPriv(cptr, PRIV_UNLIMIT_FLOOD);
+
+ if (DBufLength(&(cli_recvQ(cptr))) > feature_int(FEAT_CLIENT_FLOOD) && !HasUnlimitFlood)
return exit_client(cptr, cptr, &me, "Excess Flood");
while (DBufLength(&(cli_recvQ(cptr))) && !NoNewLine(cptr) &&
return exit_client(cptr, cptr, &me, "Excess Flood");
while (DBufLength(&(cli_recvQ(cptr))) && !NoNewLine(cptr) &&
- (IsTrusted(cptr) || cli_since(cptr) - CurrentTime < 10))
+ (IsTrusted(cptr) || cli_since(cptr) - CurrentTime < 10
|| HasUnlimitFlood
))
{
dolen = dbuf_getmsg(&(cli_recvQ(cptr)), cli_buffer(cptr), BUFSIZE);
/*
{
dolen = dbuf_getmsg(&(cli_recvQ(cptr)), cli_buffer(cptr), BUFSIZE);
/*
@@
-862,6
+864,11
@@
static void client_sock_callback(struct Event* ev)
case ET_ERROR: /* an error occurred */
fallback = cli_info(cptr);
cli_error(cptr) = ev_data(ev);
case ET_ERROR: /* an error occurred */
fallback = cli_info(cptr);
cli_error(cptr) = ev_data(ev);
+ /* If the OS told us we have a bad file descriptor, we should
+ * record that for future reference.
+ */
+ if (cli_error(cptr) == EBADF)
+ cli_fd(cptr) = -1;
if (s_state(&(con_socket(con))) == SS_CONNECTING) {
completed_connection(cptr);
/* for some reason, the os_get_sockerr() in completed_connect()
if (s_state(&(con_socket(con))) == SS_CONNECTING) {
completed_connection(cptr);
/* for some reason, the os_get_sockerr() in completed_connect()