Skip to content

Fix network printer protocol classification and merging - #498

Merged
alexpevzner merged 9 commits into
masterfrom
fix/network-printer-protocol-merging
Nov 13, 2026
Merged

alexpevzner merged 9 commits into
masterfrom
fix/network-printer-protocol-merging

Conversation

@SinghCod3r

Copy link
Copy Markdown
Collaborator

Summary

Fix network printer protocol classification and merging when printers are discovered through DNS-SD.

Previously, the discovery mechanism could be confused with the actual printer connection protocol. For example, an AppSocket printer discovered through DNS-SD could be incorrectly treated as a DNS-SD printer depending on discovery order.

This change determines the connection protocol from the URI and DNS-SD service type, and normalizes equivalent connection methods before creating/merging PhysicalDevice instances.

Changes

  • Detect LPD printers from _printer._tcp.local DNS-SD services.
  • Detect AppSocket printers from _pdl-datastream._tcp.local DNS-SD services.
  • Detect IPP/IPPS from _ipp._tcp.local and _ipps._tcp.local.
  • Canonicalize DNS-SD LPD results to lpd://.
  • Canonicalize DNS-SD AppSocket results to socket://.
  • Ignore DNS-SD UUIDs when determining the canonical connection URI.
  • Prefer explicit ipp:// / ipps:// protocol information over the DNS-SD discovery mechanism.
  • Classify LPD and AppSocket printers as legacy network printers.
  • Keep IPP and IPPS printers under DNS-SD network printer classification.
  • Ensure different physical printers discovered through the same protocol remain separate.
  • Improve merging of different representations of the same physical printer.

Testing

Automated tests cover:

  • Protocol detection from explicit and DNS-SD URIs.
  • URI canonicalization.
  • Network printer classification.
  • Physical device merging.
  • UUID-independent matching.
  • IPP/IPPS handling.

Manual GUI testing was also performed with the go-mfp simulator:

  • LPD → Network Printer (Legacy) → LPD/LPR
  • AppSocket → Network Printer (Legacy) → AppSocket/HP JetDirect
  • Multiple AppSocket printers remain separate.
  • IPP → Network Printer (DNS-SD) → IPP
  • IPPS → Network Printer (DNS-SD) → IPPS
  • Direct socket://IP printers remain classified as legacy printers.

@alexpevzner
alexpevzner merged commit c0ea839 into master Nov 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants