apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.85k stars 451 forks source link

Further to STR 299 #369

Closed michaelrsweet closed 20 years ago

michaelrsweet commented 20 years ago

Version: 1.1.20rc2 CUPS.org User: steve.p.walsh.hp

OS is Solaris 8

Hope the following is of some help in reproducing this problem.

Attached file includes error_log extract access_log extract and saved source of printers page plus cupsd.conf.

You can see from the page source that localhost is explicitly defined for the Default Desination but all other printers are defined relative to current location.

Steps taken were:

open page https://UWSAU28W1001/ select Manage Printers

From then on ( not in logs ) if I select Default I am taken to http:://UWSAU28W1001:631, then select Printers followed by Default again I get http://localhost:631 and so on in a loop.

michaelrsweet commented 20 years ago

CUPS.org User: mike

OK, I think I've discovered the source of the problems; the current code does not rewrite the default printer URI the same way as the other printers; specifically, it forces a http: URL... :)

This will be fixed in CVS shortly...

michaelrsweet commented 20 years ago

CUPS.org User: mike

OK, see the attached patch for a fix; will be part of 1.1.20... :)

michaelrsweet commented 20 years ago

"str369.patch":

Index: classes.c

RCS file: /development/cvs/cups/cgi-bin/classes.c,v retrieving revision 1.25 diff -u -r1.25 classes.c --- classes.c 20 Jul 2003 03:35:03 -0000 1.25 +++ classes.c 7 Nov 2003 18:50:11 -0000 @@ -128,38 +128,12 @@

   if ((attr = ippFindAttribute(response, "printer-uri-supported", IPP_TAG_URI)) != NULL)
   {

- */

- server = getenv("SERVER_NAME");

- hostname, &port, resource);

- strcpy(hostname, "localhost");

- */

- resource);

@@ -221,22 +339,7 @@ nameptr, / Pointer into name / value[16384], / Value(s) / *valptr; / Pointer into value */

- */

- gethostname(servername, sizeof(servername));

- */

- ishttps = getenv("HTTPS") != NULL;

@@ -334,7 +422,7 @@ * attribute... */

- hostname, &port, rawresource);

- */

- resptr++ = rawptr++;

- *resptr = '\0';

- */

- */

- */

- }

- */

- server = getenv("SERVER_NAME");

- hostname, &port, resource);

- strcpy(hostname, "localhost");

- */

- resource);