frustration Re: FW: [PATCH] Stop packet_recv greediness, stop using event_add_timed

Sam Liddicott sam at
Tue May 19 14:33:54 GMT 2009

* Stefan (metze) Metzmacher wrote, On 19/05/09 15:23:
> Sam Liddicott schrieb:
>> * Stefan (metze) Metzmacher wrote, On 19/05/09 14:02:
>>> I think the long term goal should be to use the tstream api
>>> and drop the packet_*() api. The packet_*() api has far to many knobs
>>> now and it's too complex. With the tstream it should be easy to
>>> implement the read 4 => read rest logic, while it optimizes out the
>>> epoll calls.
>>> I hope I'll have time to update the documentation from the tsocket api
>>> to the much simpler tstream api.
>>> For now I'll just apply your patch.
>> wow. Thanks Metze.
> BTW: would this patch also solve your problem?
gah! yes! (gnashes teeth in private, waits a few minutes for the foam to

I can't believe I didn't spot this, and all the more funny now is the
comment in my patch:
            /* It would be nice if there was pc->min_packet_size()
             * that could tell us this */
            /* if (pc->min_packet_size) {
                min_packet_size = pc->min_packet_size(pc->private_data);
             } */

where I "cleverly" anticipated later doing that which had already been
done just 3 lines above:

    } else if (pc->initial_read != 0) {
        npending = pc->initial_read - pc->num_read;
    } else {

(Sam thinks he can hear faint laughter all the way from Gottingen)

Thanks for spotting that.

Other points about the difficulty in offering patches still stand to
thin about another day, but you clearly take first place today in
reducing the patch to 1 line! You could only beat that by increasing
functionality or fixing bugs purely by deleting code.

Thanks again. Feel free to ditch my patch and add that one, I won't
whine. (honestly)


More information about the samba-technical mailing list