[cups] CUPS-Add-Modify-Printer question

Michael Sweet msweet at apple.com
Thu Jul 7 05:56:16 PDT 2016


Dmitry,

Please file a bug on this so we can track the fix:

    https://github.com/apple/cups/issues

Thanks!


> On Jul 6, 2016, at 7:38 AM, Дмитрий Воронин <carriingfate92 at yandex.ru> wrote:
> 
> 
> Hello,
> 
> I have a client application, that send CUPS-Add-Modify-Printer request to CUPS.
> 
> I find, that CUPS call function add_printer() for this request. During the function add_printer() calling, CUPS call set_printer_defaults() function.
> 
> Setting of some defaults attributes (like printer's policy name) is implied in function set_printer_defaults(), which can send error (via send_ipp_status()), if something bad and returns.
> But at the end of function add_printer() I see, that
> 
> con->response->request.status.status_code = IPP_OK;
> 
> So, status code (that could be not IPP_OK) is rewriting by this row. So on, we have error message like client-not-possible-error and Cups-Add-Modify-Printer returns IPP_OK in log.
> 
> My proposals:
> 
> 1. Move the row
> 
> con->response->request.status.status_code = IPP_OK;
> 
> from end of add_printer() function to start.
> 
> OR
> 
> 2. Check status code after calling set_printer_defaults() and if status is not IPP_OK return from add_printer() function.
> 
> 
> Thank you.
> -- 
> Best regards, Dmitry Voronin
> _______________________________________________
> cups mailing list
> cups at cups.org
> https://www.cups.org/mailman/listinfo/cups

_________________________________________________________
Michael Sweet, Senior Printing System Engineer




More information about the cups mailing list