Re: [PATCH 2/6] connect: uniformize and group CONNECT_DIAG_URL handling code
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- May 2, 2016, 04:56 UTC
- Message-ID
- <5726DE16.3030402@web.de>
- In-Reply-To
- <1462082573-17992-3-git-send-email-mh@glandium.org>
On 05/01/2016 08:02 AM, Mike Hommey wrote:
Show 8 quoted lines
> + 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");
or
printf("Diag: url=%s\n", url ? url : "NULL");
printf("Diag: protocol=%s\n", prot_name(protocol));
if (user)
printf("Diag: user=%s\n", user);
printf("Diag: host=%s\n", host ? host : "NULL");
printf("Diag: port=%s\n", port ? port : "NONE");
printf("Diag: path=%s\n", path ? path : "NULL");