Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipptool: problems presenting a large collection like "media-col-database" #5

Closed
michaelrsweet opened this issue May 17, 2022 · 1 comment
Labels
bug Something isn't working priority-medium
Milestone

Comments

@michaelrsweet
Copy link
Member

From @wifiprintguy in ippsample issue 241:

I used the attached .test file to perform a Get-Printer-Attributes on a printer I have, requesting "media-col-database" among other attributes. Unfortunately, while the response included a "media-col-database" attribute and value (large collection), ipptool failed to present it in its textual output.

Here's the textual output:

smitty@Serenity ipptool % ipptool -vt 'ipp://smitty-novelli-mp1.local:631/ipp/print' gpa-media-col-and-printer-input-tray.test
"gpa-media-col-and-printer-input-tray.test":
    Get-Printer-Attributes:
        attributes-charset (charset) = utf-8
        attributes-natural-language (naturalLanguage) = en
        printer-uri (uri) = ipp://smitty-novelli-mp1.local:631/ipp/print
        requested-attributes (1setOf keyword) = media-col-database,media-supported,media-col-supported,media-col-ready,media-ready,printer-input-tray
    Get printer attributes using Get-Printer-Attributes                  [PASS]
        RECEIVED: 110267 bytes in response
        status-code = successful-ok (successful-ok)
        attributes-charset (charset) = utf-8
        attributes-natural-language (naturalLanguage) = en
        media-supported (1setOf keyword) = na_executive_7.25x10.5in,na_letter_8.5x11in,na_govt-letter_8x10in,na_invoice_5.5x8.5in,iso_a5_148x210mm,iso_a4_210x297mm,jis_b5_182x257mm,jpn_hagaki_100x148mm,iso_a6_105x148mm,na_index-4x6_4x6in,na_5x7_5x7in,na_index-5x8_5x8in,na_number-10_4.125x9.5in,iso_dl_110x220mm,iso_c5_162x229mm,iso_c6_114x162mm,na_a2_4.375x5.75in,jpn_chou3_120x235mm,oe_photo_4x12in,jpn_photo-2l_127x177.8mm,jpn_oufuku_148x200mm,iso_b5_176x250mm,om_small-photo_100x150mm,na_monarch_3.875x7.5in,na_personal_3.625x6.5in,oe_photo_5x5in,custom_min_3.625x5in,custom_max_8.5x12in
        media-col-supported (1setOf keyword) = media-type,media-size,media-top-margin,media-left-margin,media-right-margin,media-bottom-margin,media-source,media-size-name
        media-col-database (1setOf collection) =         
        media-ready (1setOf keyword) = na_letter_8.5x11in,na_index-4x6_4x6in
        media-col-ready (1setOf collection) = {media-size={x-dimension=21590 y-dimension=27940} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=main media-type=stationery},{media-size={x-dimension=21590 y-dimension=27940} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=main media-type=stationery},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=296 media-bottom-margin=296 media-left-margin=296 media-right-margin=296 media-source=photo media-type=photographic-glossy},{media-size={x-dimension=10160 y-dimension=15240} media-top-margin=0 media-bottom-margin=0 media-left-margin=0 media-right-margin=0 media-source=photo media-type=photographic-glossy}
        printer-input-tray (1setOf octetString) = type=sheetFeedAutoNonRemovableTray;dimunit=micrometers;mediafeed=279400;mediaxfeed=215900;maxcapacity=100;level=58;unit=percent;status=0;name=Tray\ 1;,type=sheetFeedPull;dimunit=micrometers;mediafeed=152400;mediaxfeed=101600;maxcapacity=-2;level=-2;unit=percent;status=0;name=Tray\ 2;,type=other;dimunit=micrometers;mediafeed=-2;mediaxfeed=-2;maxcapacity=-2;level=-2;unit=percent;status=0;name=auto;
smitty@Serenity ipptool % 

Notice the line:

        media-col-database (1setOf collection) =         

gpa-media-col-and-printer-input-tray copy.test.txt
ipptool-query-and-response-no-media-col-database-presented-packet-capture.pcapng.gz

@michaelrsweet
Copy link
Member Author

OK, the current code allows up to 128k of text per attribute, and I've updated it to reallocate as needed when printing the value (128k remains for reporting EXPECT failures since there we report a single value/collection).

[master bb5eb6d] Support extremely long attribute values in ipptool output (Issue #5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-medium
Projects
Development

No branches or pull requests

1 participant