Author: vlendec
Date: 2005-09-28 11:56:46 +0000 (Wed, 28 Sep 2005)
New Revision: 10574

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10574

Log:
Revert two accidential commits
Modified:
   branches/tmp/vl-cluster/source/torture/msgtest.c
   trunk/source/printing/notify.c


Changeset:
Modified: branches/tmp/vl-cluster/source/torture/msgtest.c
===================================================================
--- branches/tmp/vl-cluster/source/torture/msgtest.c    2005-09-28 11:53:29 UTC 
(rev 10573)
+++ branches/tmp/vl-cluster/source/torture/msgtest.c    2005-09-28 11:56:46 UTC 
(rev 10574)
@@ -38,7 +38,6 @@
        pid_t pid;
        int i, n;
        char buf[12];
-       int maxfd;
 
        setup_logging(argv[0],True);
        
@@ -54,30 +53,12 @@
        pid = atoi(argv[1]);
        n = atoi(argv[2]);
 
-       printf("%d\n", getpid());
-
        message_register(MSG_PONG, pong_message);
-       maxfd = message_socket();
 
        for (i=0;i<n;i++) {
-               fd_set read_fds;
-               struct timeval one_second;
-
                message_send_pid(pid_to_procid(pid), MSG_PING, NULL, 0, True);
-               one_second = timeval_set(1,0);
-
-               FD_ZERO(&read_fds);
-               FD_SET(maxfd, &read_fds);
-               if (select(maxfd+1, &read_fds, NULL, NULL, &one_second) != 1) {
-                       DEBUG(0, ("select failed\n"));
-                       exit(1);
-               }
-               message_dispatch();
-               lp_talloc_free();
        }
 
-       exit(0);
-
        while (pong_count < i) {
                message_dispatch();
                smb_msleep(1);

Modified: trunk/source/printing/notify.c
===================================================================
--- trunk/source/printing/notify.c      2005-09-28 11:53:29 UTC (rev 10573)
+++ trunk/source/printing/notify.c      2005-09-28 11:56:46 UTC (rev 10574)
@@ -116,7 +116,7 @@
  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;
@@ -182,9 +182,9 @@
                                printer, q_len ));
                        continue;
                }
-               message_send_pid(pid_to_procid(pid_list[i]),
-                                MSG_PRINTER_NOTIFY2,
-                                buf, offset, True);
+               message_send_pid_with_timeout(pid_to_procid(pid_list[i]),
+                                             MSG_PRINTER_NOTIFY2,
+                                             buf, offset, True, timeout);
        }
 }
 
@@ -194,31 +194,15 @@
 
 void print_notify_send_messages(unsigned int timeout)
 {
-       struct timeval end;
-
-       end = timeval_current();
-       end = timeval_add(&end, timeout, 0);
-
        if (!print_notify_messages_pending())
                return;
 
        if (!create_send_ctx())
                return;
 
-       while (True) {
-               struct timeval now = timeval_current();
+       while (print_notify_messages_pending())
+               
print_notify_send_messages_to_printer(notify_queue_head->msg->printer, timeout);
 
-               if (timeval_compare(&now, &end) > 0) {
-                       break;
-               }
-
-               if (!print_notify_messages_pending()) {
-                       break;
-               }
-
-               
print_notify_send_messages_to_printer(notify_queue_head->msg->printer);
-       }
-
        talloc_free_children(send_ctx);
        num_messages = 0;
 }

Reply via email to