Steve,
Here is a more specific question I have for you regarding a code change
I made to RGBRouter_remaining(). The original functions logic works out
to the following (this version is closer to what Lawernce posted).
if (ps->cb_start < 0)
remaining = (TxSource_remaining(pself) - ps->cb_size +
ps->cb_line_size);
else
remaining = (TxSource_remaining(pself) + ps->cb_line_size -
ps->pos);
return (remaining);
As far as I can tell, cb_start can only be < 0 at two or three times:
1) When you start a fake scan to get transfer speed, 2) When you start
the real scan, 3) when your closing down everything. In case 1 & 2 it
seems to me that there are a lot of cases where the buffer will not be
full (because the fake scan doesn't attempt to read a full buffer but
that might be a bug or in case of the real scan I was thinking that the
scanner might come back with an EAGAIN error or something and give us a
partial buffer).
If I read your original email correctly you said the test for cb_start <
0 was for the end of the scan but I don't really see any code that would
drain the circular buffer after the call to RGBRouter_done().
Would you mind commenting on this part to help clear up my confusion. I
think my confusion revolves around the difference between the TxSource
buffer and the circular buffer (is there a difference?).
Thanks,
Chris
-- Chris Bagwell (mailto:cbagwell@sprynet.com) | Dallas, TX http://home.sprynet.com/~cbagwell | USA-- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
This archive was generated by hypermail 2b29 : Mon Nov 20 2000 - 19:52:02 PST