diff options
author | Jeremy Allison <jra@samba.org> | 2003-04-23 00:19:16 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-04-23 00:19:16 +0000 |
commit | c057f9faff14614f24165290bfbf53965063199d (patch) | |
tree | fdc25630db262f825cf2d83c0675b30f8041ed5a /source3/printing | |
parent | 08c2e81a18798a5d66d37e75207816e5934941a7 (diff) | |
download | samba-c057f9faff14614f24165290bfbf53965063199d.tar.gz samba-c057f9faff14614f24165290bfbf53965063199d.tar.bz2 samba-c057f9faff14614f24165290bfbf53965063199d.zip |
Limit the number of outstanding print notify messages for a process to
1000.
Jeremy.
(This used to be commit aabaac05c6adbb510ed27f87115de3e83e27158c)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/notify.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/printing/notify.c b/source3/printing/notify.c index 428eb54ce4..ee973da211 100644 --- a/source3/printing/notify.c +++ b/source3/printing/notify.c @@ -174,8 +174,15 @@ static void print_notify_send_messages_to_printer(const char *printer, unsigned if (!print_notify_pid_list(printer, send_ctx, &num_pids, &pid_list)) return; - for (i = 0; i < num_pids; i++) + for (i = 0; i < num_pids; i++) { + unsigned int q_len = messages_pending_for_pid(pid_list[i]); + if (q_len > 1000) { + DEBUG(5, ("print_notify_send_messages_to_printer: discarding notify to printer %s as queue length = %u\n", + printer, q_len )); + continue; + } message_send_pid_with_timeout(pid_list[i], MSG_PRINTER_NOTIFY2, buf, offset, True, timeout); + } } /******************************************************************* |