Skip to content

Commit e04e3e4

Browse files
committed
Clean up.
1 parent 2f33ee7 commit e04e3e4

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

tools/ipptool.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ typedef struct ipptool_expect_s // Expected attribute info
8585
expect_all; // Expect all attributes to match/not match
8686
char *name, // Attribute name
8787
*of_type, // Type name
88-
*same_count_as, // Parallel attribute name
89-
*with_value, // Attribute must include this value
88+
*same_count_as; // Parallel attribute name
89+
cups_array_t *if_defined, // Only required if variable(s) defined
90+
*if_not_defined; // Only required if variable(s) are not defined
91+
char *with_value, // Attribute must include this value
9092
*with_value_from, // Attribute must have one of the values in this attribute
9193
*define_match, // Variable to define on match
9294
*define_no_match, // Variable to define on no-match
9395
*define_value, // Variable to define with value
9496
*display_match; // Message to display on a match
95-
cups_array_t *if_defined, // Only required if variable(s) defined
96-
*if_not_defined; // Only required if variable(s) are not defined
9797
ipptool_content_t with_content; // WITH-*-CONTENT value
9898
cups_array_t *with_mime_types; // WITH-*-MIME-TYPES value(s)
9999
char *save_filespec; // SAVE-*-CONTENT filespec
@@ -605,7 +605,7 @@ main(int argc, // I - Number of command-line args
605605
}
606606

607607
if (data->outfile != cupsFileStdout())
608-
return (usage(stderr));
608+
return (usage(stderr));
609609

610610
if ((data->outfile = cupsFileOpen(argv[i], "w")) == NULL)
611611
{
@@ -714,7 +714,7 @@ main(int argc, // I - Number of command-line args
714714
{
715715
cupsLangPuts(stderr, _("ipptool: May only specify a single URI."));
716716
free_data(data);
717-
return (usage(stderr));
717+
return (usage(stderr));
718718
}
719719

720720
if (!strncmp(argv[i], "ipps://", 7) || !strncmp(argv[i], "https://", 8))
@@ -764,7 +764,9 @@ main(int argc, // I - Number of command-line args
764764
status = 1;
765765
}
766766
else if (!do_tests(testfile, data))
767+
{
767768
status = 1;
769+
}
768770
}
769771
}
770772

@@ -1058,7 +1060,7 @@ connect_printer(ipptool_test_t *data) // I - Test data
10581060
else
10591061
encryption = data->encryption;
10601062

1061-
if ((http = httpConnect(hostname, atoi(port), NULL, data->family, encryption, 1, 30000, NULL)) == NULL)
1063+
if ((http = httpConnect(hostname, atoi(port), /*addrlist*/NULL, data->family, encryption, /*blocking*/true, /*msec*/30000, /*cancel*/NULL)) == NULL)
10621064
{
10631065
print_fatal_error(data, "Unable to connect to \"%s\" on port %s: %s", hostname, port, cupsGetErrorString());
10641066
return (NULL);
@@ -1256,7 +1258,7 @@ do_monitor_printer_state(
12561258
else
12571259
encryption = data->encryption;
12581260

1259-
if ((http = httpConnect(host, port, NULL, data->family, encryption, 1, 30000, NULL)) == NULL)
1261+
if ((http = httpConnect(host, port, /*addrlist*/NULL, data->family, encryption, /*blocking*/true, /*msec*/30000, /*cancel*/NULL)) == NULL)
12601262
{
12611263
print_fatal_error(data, "Unable to connect to \"%s\" on port %d: %s", host, port, cupsGetErrorString());
12621264
return (0);
@@ -1313,7 +1315,7 @@ do_monitor_printer_state(
13131315
httpGetError(data->http) != ETIMEDOUT)
13141316
#endif // _WIN32
13151317
{
1316-
if (!httpConnectAgain(http, 30000, NULL))
1318+
if (!httpConnectAgain(http, /*msec*/30000, /*cancel*/NULL))
13171319
break;
13181320
}
13191321
else if (status == HTTP_STATUS_ERROR || status == HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED)
@@ -1691,7 +1693,7 @@ do_test(ipp_file_t *f, // I - IPP data file
16911693
httpGetError(data->http) != ETIMEDOUT)
16921694
#endif // _WIN32
16931695
{
1694-
if (!httpConnectAgain(data->http, 30000, NULL))
1696+
if (!httpConnectAgain(data->http, /*msec*/30000, /*cancel*/NULL))
16951697
data->prev_pass = false;
16961698
}
16971699
else if (status == HTTP_STATUS_ERROR || status == HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED)
@@ -1718,13 +1720,13 @@ do_test(ipp_file_t *f, // I - IPP data file
17181720
httpGetError(data->http) != ETIMEDOUT)
17191721
#endif // _WIN32
17201722
{
1721-
if (!httpConnectAgain(data->http, 30000, NULL))
1723+
if (!httpConnectAgain(data->http, /*msec*/30000, /*cancel*/NULL))
17221724
data->prev_pass = false;
17231725
}
17241726
else if (status == HTTP_STATUS_ERROR)
17251727
{
17261728
if (!Cancel)
1727-
httpConnectAgain(data->http, 30000, NULL);
1729+
httpConnectAgain(data->http, /*msec*/30000, /*cancel*/NULL);
17281730

17291731
data->prev_pass = false;
17301732
}
@@ -6832,7 +6834,7 @@ with_content(
68326834

68336835
encryption = (!strcmp(scheme, "https") || !strcmp(scheme, "ipps") || port == 443) ? HTTP_ENCRYPTION_ALWAYS : HTTP_ENCRYPTION_IF_REQUESTED;
68346836

6835-
if ((http = httpConnect(host, port, NULL, AF_UNSPEC, encryption, 1, 30000, NULL)) == NULL)
6837+
if ((http = httpConnect(host, port, /*addrlist*/NULL, AF_UNSPEC, encryption, /*blocking*/true, /*msec*/30000, /*cancel*/NULL)) == NULL)
68366838
{
68376839
add_stringf(errors, "Unable to connect to \"%s\" on port %d: %s", host, port, cupsGetErrorString());
68386840
ret = false;

0 commit comments

Comments
 (0)