summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-01-30 23:55:58 +0000
committerJeremy Allison <jra@samba.org>2003-01-30 23:55:58 +0000
commitbbf9f09ee5c58e348eef33448d2c38e588adb66a (patch)
tree69d4922f84219502a123dc29c52a5f96d5f048d2 /source3/printing
parent920287bf6b6950abfac53e6430954aee7e76bd15 (diff)
downloadsamba-bbf9f09ee5c58e348eef33448d2c38e588adb66a.tar.gz
samba-bbf9f09ee5c58e348eef33448d2c38e588adb66a.tar.bz2
samba-bbf9f09ee5c58e348eef33448d2c38e588adb66a.zip
Add 3 second timeout when terminating server and sending print notify
messages. Stops build-up of large numbers of smbd's waiting to terminate on large print throughput. Jeremy. (This used to be commit 07efebb98473cb3d4adc6b2e0afef3f06dcc99b8)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/notify.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/printing/notify.c b/source3/printing/notify.c
index a89eb3f13c..62169e982e 100644
--- a/source3/printing/notify.c
+++ b/source3/printing/notify.c
@@ -56,7 +56,7 @@ BOOL print_notify_messages_pending(void)
Send the batched messages - on a per-printer basis.
*******************************************************************/
-static void print_notify_send_messages_to_printer(const char *printer)
+static void print_notify_send_messages_to_printer(const char *printer, unsigned int timeout)
{
char *buf;
struct notify_queue *pq, *pq_next;
@@ -109,14 +109,14 @@ static void print_notify_send_messages_to_printer(const char *printer)
return;
for (i = 0; i < num_pids; i++)
- message_send_pid(pid_list[i], MSG_PRINTER_NOTIFY2, buf, offset, True);
+ message_send_pid_with_timeout(pid_list[i], MSG_PRINTER_NOTIFY2, buf, offset, True, timeout);
}
/*******************************************************************
Actually send the batched messages.
*******************************************************************/
-void print_notify_send_messages(void)
+void print_notify_send_messages(unsigned int timeout)
{
if (!print_notify_messages_pending())
return;
@@ -125,7 +125,7 @@ void print_notify_send_messages(void)
return;
while (print_notify_messages_pending())
- print_notify_send_messages_to_printer(notify_queue_head->printername);
+ print_notify_send_messages_to_printer(notify_queue_head->printername, timeout);
talloc_destroy_pool(send_ctx);
}