All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
	"lersek@redhat.com" <lersek@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v1 repost 2] block/curl: Improve type safety of s->timeout.
Date: Sun, 26 Oct 2014 10:57:59 +0000	[thread overview]
Message-ID: <20141026105759.GU15695@redhat.com> (raw)
In-Reply-To: <544CD319.40601@huawei.com>

On Sun, Oct 26, 2014 at 06:55:21PM +0800, Gonglei wrote:
> 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."

OK, so our coding style is about introducing fragility and long
range dependencies.  v2 coming up ...

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

      reply	other threads:[~2014-10-26 10:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-26  8:42 [Qemu-devel] [PATCH v1 repost 2] block/curl: Improve type safety of s->timeout Richard W.M. Jones
2014-10-26  8:42 ` Richard W.M. Jones
2014-10-26  8:57   ` Gonglei
2014-10-26 10:22     ` Richard W.M. Jones
2014-10-26 10:45       ` Gonglei
2014-10-26 10:48         ` Richard W.M. Jones
2014-10-26 10:55           ` Gonglei
2014-10-26 10:57             ` Richard W.M. Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141026105759.GU15695@redhat.com \
    --to=rjones@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=kwolf@redhat.com \
    --cc=lersek@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.