Skip to content

Commit

Permalink
Merge pull request #1054 from zdohnal/eve-tolerate-missing-media-dat
Browse files Browse the repository at this point in the history
scheduler: Tolerate devices breaking IPPEVE specs if possible
  • Loading branch information
zdohnal authored Sep 19, 2024
2 parents 6dd0c14 + a2baec6 commit 0743f17
Showing 1 changed file with 16 additions and 1 deletion.
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

0 comments on commit 0743f17

Please sign in to comment.