[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 repost 2] block/curl: Improve type safety of
From: |
Gonglei |
Subject: |
Re: [Qemu-devel] [PATCH v1 repost 2] block/curl: Improve type safety of s->timeout. |
Date: |
Sun, 26 Oct 2014 18:55:21 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 |
On 2014/10/26 18:48, Richard W.M. Jones wrote:
> On Sun, Oct 26, 2014 at 06:45:02PM +0800, Gonglei wrote:
>> On 2014/10/26 18:22, Richard W.M. Jones wrote:
>>
>>> It's just there to stop unreasonable timeouts or negative numbers.
>>> 100000 s is 27 hours, and no webserver I know of would keep a
>>> connection open that long. Possibly not even the IP stack.
>>>
>>
>> Yes, it is. But 26 hours is OK? I just think we should assure the timeout
>> as reasonable range, absolutely 100000 is too big IMO.
>>
>>> What's the difference between defining a number at the top of the file
>>> to be used once, and placing it exactly where it is used? Except the
>>> former introduces long range dependencies into the code making it
>>> harder to read and more fragile when changed.
>>
>>
>> That's the purpose using macro. If this value is used only one place in the
>> curl.c (or other c files) now and future, you are fine with it. :)
>
> I don't understand this part. Can you explain how you think a macro
> should be used?
>
Sorry for misapprehension. I mean that's the purpose using macro what your
said:
" Except the former introduces long range dependencies into the code making it
harder to read and more fragile when changed."
Best regards,
-Gonglei