samba-technical@lists.samba.org
[Top] [All Lists]

Re: [PATCH]: Fix the bug tevent_req_poll() loops forever(was: [PATCH] (p

Subject: Re: [PATCH]: Fix the bug tevent_req_poll) loops forever(was: [PATCH] (partial) tevent_req_poll() loops for ever....
From: "Stefan (metze) Metzmacher"
Date: Sun, 17 May 2009 10:30:24 +0200
Hi Bo,

The return NULL before the tevent_req_create() call is wrong.
we need to just do a

if (cli->fd == -1) {
    tevent_req_nterror(req, NT_STATUS_CONNECTION_IVALID);
    return tevent_req_post(req);
}

after it, otherwise the caller thinks the error would be
NT_STATUS_NO_MEMORY.

I also think it's wrong to hande NT_STATUS_PIPE_BROKEN in the callers.
to close the connection. That should happen directly when
read_packet_recv() fails. Because I assume the NT_STATUS_PIPE_BROKEN
is not the only error that can happen and we should disconnect on any
error from read_packet_recv().

metze

> boyang wrote:
>> Jeremy Allison wrote:
>>   
>>> Ok, I've reviewed this carefully (with some test code) and you're
>>> completely correct.
>>>
>>> We'll have to deal with this, I've talked to Volker and he has
>>> some ideas on how to deal with this efficiently.
>>>   
>>>     
>>   
> Hi, everyone:
>      Can someone please have a look at this? If it looks ok, I'll push
> it to master. :-) Because there is change to struct cli_state, I need
> someone to comment on this to see if it has any side effect, or
> anything. :-)
>      Thanks!
> Best
>           Regards
> BoYang
>>
>>   
> 
> 


<Prev in Thread] Current Thread [Next in Thread>