[cups] CUPS-Add-Modify-Printer question

Дмитрий Воронин carriingfate92 at yandex.ru
Wed Jul 6 04:38:51 PDT 2016


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



More information about the cups mailing list