On Fri, Oct 27, 2000 at 04:33:03PM -0400, Edwin Lim wrote:
> I think this is similar to the problem that I have seen (and just reported
> a day ago). [...]
I've spent some time looking at both versions of ifhp.c by now
(3.3.13, which always appeared to work well, and 3.4.1, which does
not).
3.3.13 had a function Read_write_timemout that would return the number
of bytes still left to be written, or -1 for an error.
Do_waitend would adjust its buffer accordingly:
len = Read_write_timeout( input_fd, &flag,
output_fd, Outbuf, Outlen, timeout );
DEBUG3("Do_waitend: write len %d, flag %d", len, flag );
if( len < 0 ){
break;
} else if( len >= 0 ){
memmove(Outbuf, Outbuf+(Outlen - len), len);
Outlen = len;
}
Apparently this is why Do_waitend was patient for more than waitend_interval
seconds when trying to request status information from the printer:
It could read something even though writing was stalled, and writing
would just be retried or continued later.
The new Write_read_timeout function insists on writing all of the
buffer in one timeout interval (usually 300 seconds), or it will
report an error -- its return value is either 0 (success) or -1 (error),
it's no longer possible to report that some data could be read
but not all data could be written.
Some documentations bugs that I can blame for confusing me if the
above analysis turns out to be incorrect [ :-) ]:
1. The comment for Read_status_timeout should be changed:
* Return:
* >0 - status read
* 0 - no status read
* <0 - erro
Read_status_timeout (like Write_read_timeout) actually never returns >0
(and the code calling Read_status_timeout wouldn't be able to handle a
positive return value).
2. Some debug messages still refer to 'Read_status_line', which does
no longer exist.
--
Bodo M�ller <[EMAIL PROTECTED]>
PGP http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller/0x36d2c658.html
* TU Darmstadt, Theoretische Informatik, Alexanderstr. 10, D-64283 Darmstadt
* Tel. +49-6151-16-6628, Fax +49-6151-16-6036
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------