Subject: Small buglet in pap

From: Christer Weinigel <[email-masked]>
Date: Wed, 16 Aug 1995 15:19:58 +0200

There is a small bug in the pap program.  When printing to the
HP Laserjet 4 or Laserjet IIg at our site, pap would get a timeout
after about 20 pages and abort the print.

This is the problem: The timeout `tv' is not reset after select has
timed out, and since select modifies tv to reflect the time remaining,
pap won't wait for a response after sending a `tickle'.

BTW, I'm quite new to the netatalk-admins list, so if I should mail
this somewhere else, please tell me.

  /Christer

--- netatalk-1.3.3b2/bin/pap/pap.c.orig	Mon Apr 10 01:11:15 1995
+++ netatalk-1.3.3b2/bin/pap/pap.c	Wed Aug 16 15:12:55 1995
@@ -380,9 +380,6 @@
     int			cc, i;
     unsigned short	netseq;
 
-    tv.tv_sec = 60;
-    tv.tv_usec = 0;
-
     /*
      * Ask for more data.
      */
@@ -409,6 +406,9 @@
 	    FD_SET( fd, &fds );
 	}
 	FD_SET( atp_fileno( atp ), &fds );
+
+	tv.tv_sec = 60;
+	tv.tv_usec = 0;
 
 	if (( cc = select( FD_SETSIZE, &fds, 0, 0, &tv )) < 0 ) {
 	    perror( "select" );