From bbf9f09ee5c58e348eef33448d2c38e588adb66a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Jan 2003 23:55:58 +0000 Subject: 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) --- source3/printing/notify.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/printing') 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); } -- cgit