Hi Gaston,
On 10/12/07, Gaston Dombiak <[EMAIL PROTECTED]> wrote:
> Hey everyone,
>
> It seems that BaseIoSession#getScheduledWriteRequests() is returning an
> incorrect value. The value is always negative and the write queue is empty
> (in my example). IIRC, the idea of using a counter instead of asking the
> size of the collection was a recent optimization. I checked the code I
> found something like this that could be the reason for this problem:
>
> In SocketFilterChain#doWrite(IoSession session, WriteRequest
> writeRequest):
>
> int remaining = buffer.remaining();
> if (remaining == 0) {
> s.increaseScheduledWriteRequests();
> } else {
> s.increaseScheduledWriteBytes(buffer.remaining());
> }
>
> writeRequestQueue.add(writeRequest);
>
> As you see the counter is not always incremented and at the same time the
> queue is getting a new element added. I don't know if the problem is only
> here or also when taking things out of the queue. May be encapsulating in
> a single method the "add to queue" and "increment counter" could be a way
> to avoid this problem.
>
> BTW, I'm using MINA 1.1.3.
Thanks for the bug report. I fixed the problem and now you should see
the correct values. Please let me know if it still doesn't work. It
seems like the socket implementation in the trunk is not affected by
this bug though.
Please let me know if the latest snapshot fixes the problem.
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6