Subject: [netatalk-admins] pap gets stuck, blocked, whatever...

From: "Brad G. Parks" <[email-masked]>
Date: Fri, 19 Jun 98 17:21:29 -0500

Well, more precisely, it's the ifpap/pap/ofpap usage that gets hung.
Whenever I use pap to directly send a file to a printer there's never
a problem.  (The printer I'm testing with is a 12/640 PS, although
I have experienced this problem on one or two other Apple printers.)

My printcap entry is fine, everything works about 80% of the time.
But every once in a while, pap gives up on sending a job to the
printer.  I do not want to use the LPD port of the Apple printers
because I need to count pages.

I've watched many packets fly across the network between pap and
the printer and have determined that it is definitely pap that gets
stuck -- the printer sends a few more packets to the server but it
never answers.

After much tracking it down, I have found the culprit to be in
libatalk/atp/atp_packet.c  -- the recvfrom() call in middle of
recv_atp.  I'm guessing that our little socket is blocking...

So, my question is:  What can I do about it?
   Do I dare set the socket to non-blocking?
   Should I write some sort of wrapper to use pap more directly?
   Do I want to put in a little signal/timer/something to abort
          the recvfrom()?  Would that even do any good?

-Brad G. Parks
bparks NEAR bethel.edu