Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions doc/sphinx_source/using/tcl-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,28 @@ strip <idx> [+/-strip-flags]

Module: core

^^^^^^^^^^^^^^^^^^^
page <idx> [number]
^^^^^^^^^^^^^^^^^^^

Description: This allows you to slow down the number of lines the bot sends

to a user at once via the partyline. When enabled, any commands that send

greater than the specified number of lines will stop when that number is

reached and wait for the user to type another command (or press enter) to

continue. If the user has too many pending lines, he may be booted off the

bot.

Returns: new value of page lines for that user (or the current value, if

status was omitted)

Module: core

^^^^^^^^^^^^^^^^^^^^^^^^^^^
putbot <bot-nick> <message>
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ dcc.o: dcc.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/base64.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/explicit_bzero.h compat/strlcpy.h \
tandem.h md5/md5.h
modules.h mod/modvals.h tandem.h md5/md5.h
dccutil.o: dccutil.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/base64.h \
Expand Down
22 changes: 18 additions & 4 deletions src/dcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "main.h"
#include <errno.h>
#include "modules.h"
#include "tandem.h"

/* Includes for botnet md5 challenge/response code <cybah> */
Expand Down Expand Up @@ -926,17 +927,27 @@ static void append_line(int idx, char *line)
struct msgq *p, *q;
struct chat_info *c = (dcc[idx].type == &DCC_CHAT) ? dcc[idx].u.chat :
dcc[idx].u.file->chat;
module_entry *me;
char line_r[LOGLINELEN];

if (c->current_lines > 1000) {
if (c->current_lines > 2000) {
/* They're probably trying to fill up the bot nuke the sods :) */
for (p = c->buffer; p; p = q) {
q = p->next;
nfree(p->msg);
nfree(p);
}
c->buffer = 0;

/* Turn paging off to avoid infinite loop */
dcc[idx].status &= ~STAT_PAGE;
do_boot(idx, botnetnick, "too many pages - sendq full");
if ((me = module_find("console", 1, 1))) {
Function *func = me->funcs;
(func[CONSOLE_DOSTORE]) (idx);
}
debug0("dcc.c: append_line(): Paging turned off.");

do_boot(idx, botnetnick, "more than 1000 page lines - sendq full");
return;
}
if ((c->line_count < c->max_line) && (c->buffer == NULL)) {
Expand All @@ -948,13 +959,16 @@ static void append_line(int idx, char *line)
q = NULL;
else
for (q = c->buffer; q->next; q = q->next);
/* get_data_ptr() -> n_malloc() could destroy line, so copy line to line_r
* to make append_line() reentrant
*/
strlcpy(line_r, line, sizeof line_r);

p = get_data_ptr(sizeof(struct msgq));

p->len = l;
p->msg = get_data_ptr(l + 1);
p->next = NULL;
strcpy(p->msg, line);
strlcpy(p->msg, line_r, l + 1);
if (q == NULL)
c->buffer = p;
else
Expand Down
Loading