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

Bug#360385: Case problems in device.cpp Uri matching



Hi Laurent, Henrique, 

On Tue, Apr 04, 2006 at 12:26:21AM +0200, Laurent Aguerreche wrote:
> to prove that the problem comes from the test in file
> hplip-0.9.9/io/hpiod/device.cpp at line 919, I commented the code:
> 
> [...]
> 
>  blackout:
>     pthread_mutex_unlock(&mutex);
> 
> 
> and know, it works...
> 
> So, somewhere "model" is uppercased or misread but I don't know why and
> where, or "model" should be lowercased...
 
I upgraded hplip yesterday and could not print anymore today. I found
the following line in my logs: 

Apr  4 11:49:11 pulsar hpiod: invalid model DeskJet_990C != DESKJET_990C
Device::Open io/hpiod/device.cpp 919


This looked quite like this bug report so I tried to validate that
assumption by using strcasecmp instead of strcmp in Device::Open. That 
did not help though, the new problem was a bit less informational:

Apr  4 12:11:20 pulsar hpiod: unable to Device::Open
hp:/usb/DESKJET_990C?serial=ES08P1C14YLG io/hpiod/device.cpp 870

For that reason I instrumented some of that code (after giving up using
gdb) which turned out the problem was in this line of Device::IsUri:

     if (strcmp(uriModel, gen) != 0)

It showed that uriModel was uppercase and gen (received from the
printer) was mixed case. The uppercase version in fact seemed to come 
from my printers.conf of cups, so I changed it to the same mixed case of

  DeviceURI hp:/usb/DeskJet_990C?serial=ES08P1C14YLG

After that change it works again, even with the hplip in the
distribution. 



I have to add that I did not specify the name of the printer at any
time. It was auto detected during installation back then so I assume
that this will break for many people during upgrade. When time permits
I'll install an older version again on a test system and check if an 
upgrade reproduces this problem.

Greetings

	Torsten


Attachment: signature.asc
Description: Digital signature


Reply to: