After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 467414 - gtkcupsutil.c won't build with cups 1.3
gtkcupsutil.c won't build with cups 1.3
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.11.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-08-16 18:58 UTC by Claudio Saavedra
Modified: 2007-09-07 18:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a better approach than current (2.21 KB, patch)
2007-08-16 19:19 UTC, Claudio Saavedra
none Details | Review
fixed version (2.31 KB, patch)
2007-08-16 20:02 UTC, Claudio Saavedra
none Details | Review

Description Claudio Saavedra 2007-08-16 18:58:01 UTC
API changes in CUPS 1.3 break gtkcupsutil.c build. From V1.3b1 changelog:

"- Moved the definition of the (private) _http_s structure
   to http-private.h; code that directly accesses the
   http_t members will no longer compile!"
Comment 1 Claudio Saavedra 2007-08-16 19:04:19 UTC
Ok, it seems that configuring again after upgrading cups makes the trick. However, it is still possible to access the http.authstring field by using httpGetAuthString () (added in cups 1.3):

Something on the line of this would make it:

Index: gtkcupsutils.c
===================================================================
--- gtkcupsutils.c      (revision 18633)
+++ gtkcupsutils.c      (working copy)
@@ -971,6 +971,8 @@ _get_send (GtkCupsRequest *request)
   httpClearFields (request->http);
 #ifdef HAVE_HTTP_AUTHSTRING
   httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, request->http->authstring);
+#else
+  httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, httpGetAuthString (request->http));
 #endif
 
   if (httpGet (request->http, request->resource))
Comment 2 Claudio Saavedra 2007-08-16 19:19:49 UTC
Created attachment 93806 [details] [review]
a better approach than current

I think this approach is a bit cleaner than current. Check if the 1.3 API is available and if so, use httpGetAuthString() instead of accessing the http.authstring field directly.

hth
Comment 3 Claudio Saavedra 2007-08-16 20:02:33 UTC
Created attachment 93810 [details] [review]
fixed version

a bit cleaner (some autotools magic)
Comment 4 Jan Arne Petersen 2007-08-17 19:50:02 UTC
There are some really old cups versions with no authstring at all. So there should probably be still another test.
Comment 5 Claudio Saavedra 2007-08-17 20:33:06 UTC
Is gtk+ really targeting such cups versions?
Comment 6 Claudio Saavedra 2007-08-21 14:32:38 UTC
This also seems to be affecting the stable branch.

http://mail.gnome.org/archives/gtk-list/2007-August/msg00080.html
Comment 7 Matthias Clasen 2007-09-07 18:35:25 UTC
Committed a slightly different patch

2007-09-07  Matthias Clasen  <mclasen@redhat.com>

        * configure.in: Check for the cups function httpGetAuthString().

        * modules/printbackends/cups/gtkcupsutils.c: Use httpGetAuthString()
        if available.  (#467414, Claudio Saavedra)