[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] packet: elide two buffer_prepend calls into one


On Tuesday 04 February 2014 23:51:54 Jon Simons wrote:
> Attached is a patch which should reduce the amount of
> work done by packet_send2.

Hi Jon,

the patch is great! I just would like to have a cosmetic change. I would like 
to have this all over libssh :)

> + if (buffer_prepend_data(session->out_buffer, &header, sizeof(header)) < 0) 
{

I prefrer

rc = buffer_prepend_data(session->out_buffer, &header, sizeof(header);
if (rc < 0) {

...


In gdb it is easier to debug:

gdb> print rc

Well here probably we only use -1 and 0 but if there are more values it is 
easier to debug. I would like to see this in all new code we commit. This is 
best practice in Samba code, we often spend a lot of time in the debugger and 
this makes our live a lot easier.


Thanks for your time and contributions!



	-- andreas


-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx


Follow-Ups:
Re: [PATCH] packet: elide two buffer_prepend calls into oneJon Simons <jon@xxxxxxxxxxxxx>
References:
[PATCH] packet: elide two buffer_prepend calls into oneJon Simons <jon@xxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org