Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler: Tolerate devices breaking IPPEVE specs if possible #1054

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion scheduler/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5319,7 +5319,7 @@ create_local_bg_thread(
* try to get it separately
*/

if (ippFindAttribute(response, "media-col-database", IPP_TAG_ZERO) ==
if (ippFindAttribute(response, "media-col-database", IPP_TAG_BEGIN_COLLECTION) ==
NULL)
{
ipp_t *response2;
Expand Down Expand Up @@ -5356,6 +5356,21 @@ create_local_bg_thread(
}
}

if (ippFindAttribute(response, "media-col-database", IPP_TAG_BEGIN_COLLECTION) == NULL
&& ippFindAttribute(response, "media-supported", IPP_TAG_ZERO) == NULL
&& ippFindAttribute(response, "media-size-supported", IPP_TAG_BEGIN_COLLECTION) == NULL)
{
cupsdLogMessage(CUPSD_LOG_ERROR, "The printer %s doesn't provide attributes \"media-col-database\", \"media-size-supported\" or \"media-supported\" required for generating printer capabilities.", printer->name);

/* Force printer to timeout and be deleted */
cupsRWLockWrite(&printer->lock);
printer->state_time = 0;
cupsRWUnlock(&printer->lock);

send_ipp_status(con, IPP_STATUS_ERROR_DEVICE, _("The printer %s does not provide attributes required for IPP Everywhere."), printer->name);
goto finish_response;
}

// Validate response from printer...
if (!ippValidateAttributes(response))
{
Expand Down
Loading