managing printer names (with windows, if it matters) ?

Luigi Rizzo rizzo at icir.org
Thu Sep 20 01:26:26 PDT 2007


Hi,
i have implemented a print-to-email service where i pass, as part of the printer name, the email address where to send the generated pdf.

So I have a printer named 'foo', and clients access 'foo::myself at my.email.server'. A small patch to http-support.c in function  httpSeparateURI() strips the ':myself at my.email.server' part from the request and uses it as a username (also leaving only the part before the '::' as a printer name).

Things work as i want with a small annoyance - Windows boxes only see 'foo' as the printer name (and I cannot rename them on the Windows side), so if i have multiple instances of this printers configured on a client, i see them listed as 'foo', 'foo (Copy 1)', 'foo (Copy 2)' but have no way to tell the email address associated with each of them.

I don't think the problem is windows-specific, most likely cups returns the basename ('foo' in this example) as the printer name because i stripped the rest too early.

I suppose that a fix would be to keep the full printer name within the cups code, and implement a printer-name matching that ignores the part after the '::'. Any idea on where this could be done ?
At first sight, it seems that i could play with the 'compare' function used in cupsArrayFind() on the Printers array, or perhaps at a higher level work on  cupsdValidateDest() ?






More information about the cups mailing list