Index: backend/lpd.c =================================================================== --- backend/lpd.c (revision 10288) +++ backend/lpd.c (working copy) @@ -92,7 +92,7 @@ int mode, const char *user, const char *title, int copies, int banner, int format, int order, int reserve, int manual_copies, int timeout, - int contimeout); + int contimeout, const char *orighost); static int lpd_write(int lpd_fd, char *buffer, int length); #ifndef HAVE_RRESVPORT_AF static int rresvport_af(int *port, int family); @@ -144,6 +144,8 @@ #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) struct sigaction action; /* Actions for POSIX signals */ #endif /* HAVE_SIGACTION && !HAVE_SIGSET */ + int num_jobopts; /* Number of job options */ + cups_option_t *jobopts = NULL; /* Job options */ /* @@ -191,6 +193,8 @@ return (CUPS_BACKEND_FAILED); } + num_jobopts = cupsParseOptions(argv[5], 0, &jobopts); + /* * Extract the hostname and printer name from the URI... */ @@ -525,7 +529,9 @@ status = lpd_queue(hostname, addrlist, resource + 1, fd, snmp_fd, mode, username, title, copies, banner, format, order, reserve, - manual_copies, timeout, contimeout); + manual_copies, timeout, contimeout, + cupsGetOption("job-originating-host-name", num_jobopts, + jobopts)); if (!status) fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4])); @@ -533,7 +539,9 @@ else status = lpd_queue(hostname, addrlist, resource + 1, fd, snmp_fd, mode, username, title, 1, banner, format, order, reserve, 1, - timeout, contimeout); + timeout, contimeout, + cupsGetOption("job-originating-host-name", num_jobopts, + jobopts)); /* * Remove the temporary file if necessary... @@ -638,7 +646,8 @@ int reserve, /* I - Reserve ports? */ int manual_copies,/* I - Do copies by hand... */ int timeout, /* I - Timeout... */ - int contimeout) /* I - Connection timeout */ + int contimeout, /* I - Connection timeout */ + const char *orighost) /* I - job-originating-host-name */ { char localhost[255]; /* Local host name */ int error; /* Error number */ @@ -927,7 +936,10 @@ return (CUPS_BACKEND_FAILED); } - httpGetHostname(NULL, localhost, sizeof(localhost)); + if (orighost) + strlcpy(localhost, orighost, sizeof(localhost)); + else + httpGetHostname(NULL, localhost, sizeof(localhost)); snprintf(control, sizeof(control), "H%.31s\n" /* RFC 1179, Section 7.2 - host name <= 31 chars */