[cups.development] want to original client host to appear in lpr control file....
wtautz
wtautz at cs.uwaterloo.ca
Wed Sep 27 13:18:42 PDT 2006
Hi, I previously posted a desire to have the lpr cf file contain
the hostname of the client rather than the server if the client
browsed the printer in question. Michael gave me a hint:
The lpd_queue() function does this; you *might* be able to update the
backend to get the job-originating-host-name attribute and use that
instead of the local hostname...
I have been examining lpd.c in backend. Am I correct in deducing
that snprintf is responsible for constructing the control file contents.
In particular all calls of this functions seem to use localhost (I am
assumming
that I am on the server so its hostname is being used?)
The localhost variable is set by
httpGetHostname(NULL, localhost, sizeof(localhost));
I think.
I would like to have the value be
job-originating-host-name
attribute which I believe I can get via
(attr = ippFindAttribute(job->attrs, "job-originating-host-name",
IPP_TAG_ZERO)) != NULL)
I think attr is a pointer to some kind of record? Hopefully its a string.
I just groping in the dark at the moment...
So my naive guess is to replace localhost in the snprintf functions
calls with the output of ippFindAttribute....this after
about 10minutes of looking at the code....and I haven't programmed in C
extensively :-(
I'm tempted to try this...
walter
More information about the cups
mailing list