[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#704238: Need to document the CUPS client's new server-version option



Vincent,

On 2013-06-20, at 10:55 AM, Vincent Lefevre <vincent@vinc17.net> wrote:
>> ...
>> We *did* try tracking the supported IPP version in the first version
>> of the patch for this issue, but it didn't work reliably. Forcing
>> the issue in client.conf seemed the safest approach.
> 
> OK. So, the protocol doesn't specify a way to ask the server
> what version is running?

You can, however you need to first send a request the server will accept.  That means you can either:

a) probe by sending requests (try 2.0, then 1.1, then 1.0)
b) send a Get-Printer-Attributes request with an older version (1.0 or 1.1) and look at the ipp-versions-supported values that are returned.

Option a) is what we tried at the beginning, but has problems when you use any of the "streaming" APIs (cupsSendRequest, cupsGetResponse, cupsStartDocument/cupsWriteRequestData/cupsFinishDocument) because the caller has to have the retry logic in it.

Option b) may fail if a printer/server stops supporting IPP/1.x and involves an extra request/connection when we first start talking to the server. This can cause slowdowns or hangs.

> However would it be possible to output a real error message?
> The errors I get
> 
> ypig:~> lpq -P lipucb-mono-1
> lpq: Unknown destination "lipucb-mono-1".
> 
> ypig:~> lpstat -a
> lpstat: Bad Request
> 
> are quite uninformative, in particular the first one.
> 
> There's a difference between having an unknown printer name
> (say, like in "lpq -P does-not-exist") and having something
> wrong in the communication with the server.

In both cases the server is returning a "bad request" error instead of "version not supported".  We could (and probably should) change lpq to report the real error, but that will just yield:

    lpq: Bad Request

And since "Bad Request" can be caused by a grab bag of issues, we can't just map it to "version not supported".

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair


Reply to: