cupsConnectDest fails when dest pointer is obtained by name #1134
Unanswered
RolandHughes
asked this question in
Q&A
Replies: 1 comment 2 replies
-
What example are you referencing? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Ubuntu 20.04 doing C++ development
Could have swore I posted this yesterday but don't see it. My apologies if this is fixed in later Cups releases but my searches didn't find any mention of it.
In the standard example program one sees this.
cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
and in the print_dest routine this
http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE, 30000, NULL, resource, sizeof(resource), NULL, NULL);
all works well and good
if, however, you obtain your dest pointer via
m_cupsDest = cupsGetNamedDest( CUPS_HTTP_DEFAULT, cupsGetDefault(), NULL);
you have to connect like this
http_t *http = cupsConnectDest( m_cupsDest, CUPS_DEST_FLAGS_NONE, 30000, NULL, m_resource, RESOURCE_SIZE, NULL, NULL );
because CUPS_DEST_FLAGS_DEVICE will never work.
Is this a bug or is there a logical reason for this that simply escapes me? If it is a bug has it been fixed in later versions of cups and if so, what version?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions