istopwg / ippsample

IPP sample implementations.
http://istopwg.github.io/ippsample
Apache License 2.0
225 stars 83 forks source link

IPP options with ‘-‘ in the name ignored, when passed to ipptransform #282

Closed AFischer4 closed 1 year ago

AFischer4 commented 1 year ago

Calling ipptool -v -T 3 ipp://<IPPHost>:8000/ipp/print/<MyPrinter> -f <sample>.pdf ex-print-job.test fails to propagate IPP options with ‘-‘ in the name to ipptransform.

For example ATTR enum print-quality 5 in ex-print-job.test will be passed to ipptransform as environment variable IPP_PRINT_QUALITY=high but the function get_option() in ipptransform does not find the option, because it is looking first for a non existing command line option “print-quality” then for an environment variable “IPP_PRINT-QUALITY” and then for “IPP_PRINT-QUALITY_DEFAULT”.

The algorithm in get_option() to build the name of the environment variable must be the same, as in serverTransformJob(). At the moment the replacement of ‘-‘ to ‘_’ is missing in get_options()!

Without correction, ipptransform will ignore a lot of options set by environment variables, because the initialization in ippOptionsNew() / get_option() is looking for the wrong names. i Screenshots If applicable, add screenshots to help explain your problem.

I used ippsample "v2023.03" for the tests.

michaelrsweet commented 1 year ago

[master e895c10] Fix handling of attributes with dashes in the name (Issue #282)