From: mike Date: Mon, 21 Jan 2013 15:29:28 +0000 (+0000) Subject: When the web interface is turned off, clients cannot get icon images using the X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82c5f579476d22fd636c7843ae110f27970d396e;p=thirdparty%2Fcups.git When the web interface is turned off, clients cannot get icon images using the supplied paths. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10833 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/scheduler/client.c b/scheduler/client.c index e9abb82bb3..0fecf3786b 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -1275,7 +1275,8 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ switch (con->http.state) { case HTTP_GET_SEND : - if (!strncmp(con->uri, "/printers/", 10) && + if ((!strncmp(con->uri, "/ppd/", 5) || + !strncmp(con->uri, "/printers/", 10)) && !strcmp(con->uri + strlen(con->uri) - 4, ".ppd")) { /* @@ -1285,8 +1286,15 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ con->uri[strlen(con->uri) - 4] = '\0'; /* Drop ".ppd" */ - if ((p = cupsdFindPrinter(con->uri + 10)) != NULL) + if (!strncmp(con->uri, "/ppd/", 5)) + p = cupsdFindPrinter(con->uri + 5); + else + p = cupsdFindPrinter(con->uri + 10); + + if (p) + { snprintf(con->uri, sizeof(con->uri), "/ppd/%s.ppd", p->name); + } else { if (!cupsdSendError(con, HTTP_NOT_FOUND, CUPSD_AUTH_NONE)) @@ -1298,7 +1306,8 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ break; } } - else if ((!strncmp(con->uri, "/printers/", 10) || + else if ((!strncmp(con->uri, "/icons/", 7) || + !strncmp(con->uri, "/printers/", 10) || !strncmp(con->uri, "/classes/", 9)) && !strcmp(con->uri + strlen(con->uri) - 4, ".png")) { @@ -1309,7 +1318,9 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ con->uri[strlen(con->uri) - 4] = '\0'; /* Drop ".png" */ - if (!strncmp(con->uri, "/printers/", 10)) + if (!strncmp(con->uri, "/icons/", 7)) + p = cupsdFindPrinter(con->uri + 7); + else if (!strncmp(con->uri, "/printers/", 10)) p = cupsdFindPrinter(con->uri + 10); else p = cupsdFindClass(con->uri + 9);