Skip to content

Commit

Permalink
Add a sendq_cleared hook
Browse files Browse the repository at this point in the history
  • Loading branch information
edk0 committed Oct 17, 2020
1 parent 04952f2 commit 441075b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ extern int h_conf_read_end;
extern int h_outbound_msgbuf;
extern int h_rehash;
extern int h_cap_change;
extern int h_sendq_cleared;

void init_hook(void);
int register_hook(const char *name);
Expand Down
2 changes: 2 additions & 0 deletions ircd/hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ int h_conf_read_end;
int h_outbound_msgbuf;
int h_rehash;
int h_cap_change;
int h_sendq_cleared;

void
init_hook(void)
Expand All @@ -97,6 +98,7 @@ init_hook(void)
h_outbound_msgbuf = register_hook("outbound_msgbuf");
h_rehash = register_hook("rehash");
h_cap_change = register_hook("cap_change");
h_sendq_cleared = register_hook("sendq_cleared");
}

/* grow_hooktable()
Expand Down
5 changes: 5 additions & 0 deletions ircd/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ send_queued(struct Client *to)
send_queued_write, to);
}
else
{
hook_data_client hdata;
hdata.client = to;
ClearFlush(to);
call_hook(h_sendq_cleared, &hdata);
}
}

void
Expand Down

0 comments on commit 441075b

Please sign in to comment.