summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-01-30 23:55:13 +0000
committerJeremy Allison <jra@samba.org>2003-01-30 23:55:13 +0000
commitb102e79e751ad2d658d0681061b6d56f1027be66 (patch)
treefbdcbf383457db93e3fdb7bb73ca018b6090f9db /source3/printing
parentbcf6fae786167ad17d0c4fba5af72d509528deba (diff)
downloadsamba-b102e79e751ad2d658d0681061b6d56f1027be66.tar.gz
samba-b102e79e751ad2d658d0681061b6d56f1027be66.tar.bz2
samba-b102e79e751ad2d658d0681061b6d56f1027be66.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 4ae130bfa82be60de6a6f357f65207fcb24f45fb)
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);
}