<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p> </p>
<p>18.11.2019 18:11, Maxim Dounin wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<pre>Hello!

On Mon, Nov 18, 2019 at 05:48:46PM +0100, Sergey Brester wrote:</pre>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px">Looks like [efd71d49bde0 [2]] could be indeed responsible for that: I see at least one state where rev->ready could remain 1 (after rev->available gets 0) e. g. deviation between blocks [efd71d49bde0#l10.8 [3]] and [efd71d49bde0#l11.8 [4]] where first did not reset rev->ready and for example if ngx_socket_nread in [efd71d49bde0#l10.38 [5]] would write 0 into rev->available, so rev->ready remains 1 yet.</blockquote>
<pre>There is no deviation here.  The rev->available field holds the 
number of bytes available for reading (or -1 if it's not known), 
while rev->ready indicates if reading is possible.  The reading 
can be possible even <strong>when rev->available is zero</strong> - notably, when 
there is a potential pending EOF.</pre>
</blockquote>
<p>Sure, <br />but I told about the case where rev->ready indicates the <strong>reading is possible</strong>, <br />but <strong>rev->available is less as zero</strong>.</p>
<p>If you mean this is to noglect, then it is ok, but somehow it looks backwards incompatible to me.<br />At least other async-IO procedures (<a href="https://github.com/nginx/nginx/commit/fac4c7bdf53ee7d8fec6568f1e9fecefcde6feba#diff-0b707fd972a54f561081982c62457febR155-R158">for example KQUEUE</a>) handle this differently.</p>
<p>Anyway I saw never <strong>rev->available less as zero</strong>, if rev->ready got 1 until now.<br /><br />Regards,<br />Sergey.</p>
</body></html>