Re: [PATCH v6 1/4] config: add support for http.<url>.* settings

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

 



On Jul 19, 2013, at 13:08, Junio C Hamano wrote:
"Kyle J. McKay" <mackyle@xxxxxxxxx> writes:

@@ -337,7 +472,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)

	http_is_verbose = 0;

-	git_config(http_options, NULL);
+	git_config(http_options, (void *)url);

Can http_init() be called more than once?  max-matched-len (and
leter user-matched as well) is initialized to zero at the link time,
and never reset after it is used for matching the configuration file
entries with a single URL.

If this function is called more than once, the code needs to
memset(0) the array(s), don't it?

The http_init() function is never called more than once. It's called from http_fetch.c, http_push.c, and remote-curl.c exactly once in the main() function, so no worries. However, I do like your idea of bundling them all up into an on-stack variable, I just didn't want to stick those arrays on the stack if it's not necessary it and it seems like it isn't.

I think I will just go ahead and add the memset to http_init to avoid unexpected breakage if something in the future actually does make multiple http_init()/http_cleanup() calls during its lifetime.

[...] In any case, you no longer have to cast the second
parameter of git_config to (void *) only to defeat constness ;-)

That goes away in part 4/4 anyhow. :)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]