Re: [PATCH 2/6] connect: uniformize and group CONNECT_DIAG_URL handling code

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

 



On Mon, May 02, 2016 at 06:56:54AM +0200, Torsten Bögershausen wrote:
> On 05/01/2016 08:02 AM, Mike Hommey wrote:
> > +	if (flags & CONNECT_DIAG_URL) {
> >   		printf("Diag: url=%s\n", url ? url : "NULL");
> >   		printf("Diag: protocol=%s\n", prot_name(protocol));
> >   		printf("Diag: hostandport=%s\n", hostandport ? hostandport : "NULL");
> > +		printf("Diag: userandhost=%s\n", host ? host : "NULL");
> > +		printf("Diag: port=%s\n", port ? port : "NONE");
> >   		printf("Diag: path=%s\n", path ? path : "NULL");
> >   		conn = NULL;
> Does it make sense  to write the host twice?
> If things are cleaned up, would something like this make sense ?
> 
> 		printf("Diag: url=%s\n", url ? url : "NULL");
>  		printf("Diag: protocol=%s\n", prot_name(protocol));
> 		printf("Diag: user=%s\n", user ? user : "NULL");
>  		printf("Diag: host=%s\n", host ? host : "NULL");
> 		printf("Diag: port=%s\n", port ? port : "NONE");
>  		printf("Diag: path=%s\n", path ? path : "NULL");

That's what I'm converging towards, in the end. There is one thing that
needs hostandport, though: the git protocol host header. But I don't
really like that parse_connect_url would return user, host, port, *and*
hostandport. How about "reconstructing" hostandport in that case, adding
square brackets when the host contains colons?

BTW, the git protocol currently doesn't reject urls with users and
doesn't seem to handle them properly either. My changes would fix this
by separating user and host at the parse_connect_url level, but the
question then is what to do when there is a user part? die()?

Mike
--
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]