Skip to content

Commit

Permalink
Fix DNS-SD services over localhost.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Oct 18, 2024
1 parent a6608bb commit 4500c7e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/ippeveprinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ main(int argc, // I - Number of command-line args

printer->web_forms = web_forms;

cupsSetServerCredentials(keypath, printer->hostname, 1);
cupsSetServerCredentials(keypath, printer->hostname, true);

// Run the print service...
run_printer(printer);
Expand Down Expand Up @@ -5995,7 +5995,7 @@ register_printer(
if ((printer->services = cupsDNSSDServiceNew(printer->dnssd, if_index, printer->dnssd_name, (cups_dnssd_service_cb_t)dnssd_callback, printer)) == NULL)
goto error;

if (!cupsDNSSDServiceAdd(printer->services, "_printer._tcp", /*domain*/NULL, printer->hostname, /*port*/0, /*num_txt*/0, /*txt*/NULL))
if (!cupsDNSSDServiceAdd(printer->services, "_printer._tcp", /*domain*/NULL, /*hostname*/NULL, /*port*/0, /*num_txt*/0, /*txt*/NULL))
goto error;

// Then register the _ipp._tcp (IPP) service type with the real port number to
Expand All @@ -6005,7 +6005,7 @@ register_printer(
else
cupsCopyString(regtype, "_ipp._tcp", sizeof(regtype));

if (!cupsDNSSDServiceAdd(printer->services, regtype, /*domain*/NULL, printer->hostname, (uint16_t)printer->port, num_txt, txt))
if (!cupsDNSSDServiceAdd(printer->services, regtype, /*domain*/NULL, /*hostname*/NULL, (uint16_t)printer->port, num_txt, txt))
goto error;

// Then register the _ipps._tcp (IPP) service type with the real port number
Expand All @@ -6015,12 +6015,12 @@ register_printer(
else
cupsCopyString(regtype, "_ipps._tcp", sizeof(regtype));

if (!cupsDNSSDServiceAdd(printer->services, regtype, /*domain*/NULL, printer->hostname, (uint16_t)printer->port, num_txt, txt))
if (!cupsDNSSDServiceAdd(printer->services, regtype, /*domain*/NULL, /*hostname*/NULL, (uint16_t)printer->port, num_txt, txt))
goto error;

// Similarly, register the _http._tcp,_printer (HTTP) service type with the
// real port number to advertise our IPP printer's web interface...
if (!cupsDNSSDServiceAdd(printer->services, "_http._tcp,_printer", /*domain*/NULL, printer->hostname, (uint16_t)printer->port, num_txt, txt))
if (!cupsDNSSDServiceAdd(printer->services, "_http._tcp,_printer", /*domain*/NULL, /*hostname*/NULL, (uint16_t)printer->port, num_txt, txt))
goto error;

cupsFreeOptions(num_txt, txt);
Expand Down

0 comments on commit 4500c7e

Please sign in to comment.