When running a Printer Application (ex. ps-printer-app) as server and doing the client call
ps-printer-app devices
the use of custom backends (schemes, like "cups:" for CUPS backends in pappl-retrofit) was not taken into account, as simply papplDeviceList() was called, with neither a system created nor the devices list polled from the running server.
One could create the system before to get the custom scheme definitions in place, but the server is usually running as root and the client doing the request as the calling user. As some backends, independent of being PAPPL's own backends or any custom backends, discover devices only as root, letting the client call producing a different usually incomplete result.
Therefore we do an IPP_OP_PAPPL_FIND_DEVICES IPP request to the server to let the server auto-discover the available devices and report back the results.
There is also a bug in the server's IPP_OP_PAPPL_FIND_DEVICES (and IPP_OP_PAPPL_CREATE_PRINTERS) operation. The device list callback function _papplDeviceInfoCallback() returns "true" and not "false" after outputting an item, making the device listing process stop on the first item. making only the first discovered device listed (or only the first discovered printer set up). This is also corrected in this commit.
Fixes issue #253
When running a Printer Application (ex. ps-printer-app) as server and doing the client call
the use of custom backends (schemes, like "
cups:
" for CUPS backends in pappl-retrofit) was not taken into account, as simplypapplDeviceList()
was called, with neither a system created nor the devices list polled from the running server.One could create the system before to get the custom scheme definitions in place, but the server is usually running as root and the client doing the request as the calling user. As some backends, independent of being PAPPL's own backends or any custom backends, discover devices only as root, letting the client call producing a different usually incomplete result.
Therefore we do an
IPP_OP_PAPPL_FIND_DEVICES
IPP request to the server to let the server auto-discover the available devices and report back the results.There is also a bug in the server's
IPP_OP_PAPPL_FIND_DEVICES
(andIPP_OP_PAPPL_CREATE_PRINTERS
) operation. The device list callback function_papplDeviceInfoCallback()
returns "true
" and not "false
" after outputting an item, making the device listing process stop on the first item. making only the first discovered device listed (or only the first discovered printer set up). This is also corrected in this commit.