[PATCH]: Fix the bug tevent_req_poll() loops forever(was: [PATCH] (partial) tevent_req_poll() loops for ever....)

Stefan (metze) Metzmacher metze at samba.org
Sun May 17 08:30:24 GMT 2009

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

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().


> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20090517/2b9ef4ad/signature.bin

More information about the samba-technical mailing list