[sr-dev] Typo in tcp_read.c?

Peter Dunkley peter.dunkley at crocodile-rcs.com
Wed Mar 27 12:35:45 CET 2013


Hi,

My misunderstanding.  The part that confused me is that cfg_get(tcp, 
tcp_cfg, accept_no_cl) always checks for == 0 or !=0, but the cfg_get() 
function itself can return -1 in error cases - which doesn't seem to be 
properly handled in most places.  As a result I got a bit confused about 
the meaning of the return codes.

Thanks,

Peter

On 26/03/13 22:26, Daniel-Constantin Mierla wrote:
> Hello,
>
> On 3/26/13 10:49 PM, Peter Dunkley wrote:
>> Hello,
>>
>> I think the conditional on line 1316 of tcp_read.c is incorrect.  The
>> check is currently:
>>
>>    if (cfg_get(tcp, tcp_cfg, accept_no_cl)==0) {
>>
>> but I think it should be:
>>
>>    if (cfg_get(tcp, tcp_cfg, accept_no_cl)!=0) {
>>
>> Does anyone disagree?  If not I will fix it tomorrow.
> didn't analyze it that deep, but the printed error message inside the 
> if-block suggests the right ways is the current form.
>
> If the content-length is not found and accept_no_cl is not set (so it 
> is zero), then throw error.
> Cheers,
> Daniel
>




More information about the sr-dev mailing list