[gtk] build/cups: remove checks for httpGetAuthString and http_t.authstring



commit 4d4e02c9d0cea4113a02fca2cf0d3efefe384e78
Author: Christoph Reiter <creiter src gnome org>
Date:   Sat Jun 15 09:42:17 2019 +0200

    build/cups: remove checks for httpGetAuthString and http_t.authstring
    
    httpGetAuthString() was added with cups 1.3 and we depend on a newer version
    now. The direct field access was a fallback in case httpGetAuthString()
    was missing, so this can also be dropped.
    
    Ported to master from !938

 config.h.meson                       |  6 ------
 modules/printbackends/gtkcupsutils.c | 12 ------------
 modules/printbackends/meson.build    | 14 +++-----------
 3 files changed, 3 insertions(+), 29 deletions(-)
---
diff --git a/config.h.meson b/config.h.meson
index c75fe7f784..209b65d03c 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -56,12 +56,6 @@
 /* Define if GStreamer support is available */
 #mesondefine HAVE_GSTREAMER
 
-/* Define to 1 if you have the `httpGetAuthString' function. */
-#mesondefine HAVE_HTTPGETAUTHSTRING
-
-/* Define if cups http_t authstring field is accessible */
-#mesondefine HAVE_HTTP_AUTHSTRING
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #mesondefine HAVE_INTTYPES_H
 
diff --git a/modules/printbackends/gtkcupsutils.c b/modules/printbackends/gtkcupsutils.c
index 8e7413a20a..723923b10a 100644
--- a/modules/printbackends/gtkcupsutils.c
+++ b/modules/printbackends/gtkcupsutils.c
@@ -709,13 +709,7 @@ _post_send (GtkCupsRequest *request)
   httpClearFields (request->http);
   httpSetField (request->http, HTTP_FIELD_CONTENT_LENGTH, length);
   httpSetField (request->http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
-#ifdef HAVE_HTTPGETAUTHSTRING
   httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, httpGetAuthString (request->http));
-#else
-#ifdef HAVE_HTTP_AUTHSTRING
-  httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, request->http->authstring);
-#endif
-#endif
 
   if (httpPost (request->http, request->resource))
     {
@@ -1198,13 +1192,7 @@ _get_send (GtkCupsRequest *request)
     }
 
   httpClearFields (request->http);
-#ifdef HAVE_HTTPGETAUTHSTRING
   httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, httpGetAuthString (request->http));
-#else
-#ifdef HAVE_HTTP_AUTHSTRING
-  httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, request->http->authstring);
-#endif
-#endif
 
   if (httpGet (request->http, request->resource))
     {
diff --git a/modules/printbackends/meson.build b/modules/printbackends/meson.build
index 8dee6f0a4d..2946960d2e 100644
--- a/modules/printbackends/meson.build
+++ b/modules/printbackends/meson.build
@@ -26,19 +26,11 @@ if enable_cups
     cups_major_version = cc.compute_int('CUPS_VERSION_MAJOR', prefix : '#include <cups/cups.h>')
     cups_minor_version = cc.compute_int('CUPS_VERSION_MINOR', prefix : '#include <cups/cups.h>')
     message('Found CUPS version: @0@.@1@'.format(cups_major_version, cups_minor_version))
-    if cups_major_version >= 2
-      if cc.compiles('#include <cups/http.h> \n http_t http; char *s = http.authstring;')
-        cdata.set('HAVE_HTTP_AUTHSTRING', 1,
-          description :'Define if cups http_t authstring field is accessible')
-      endif
+    if cups_major_version < 2
+      cups_error = 'Need CUPS version >= 2.0'
+    else
       libcups = cc.find_library('cups', required : true)
-      if libcups.found() and cc.has_function('httpGetAuthString', dependencies : libcups)
-        cdata.set('HAVE_HTTPGETAUTHSTRING', 1)
-      endif
-
       print_backends += ['cups']
-    else
-      error('Need CUPS version >= 2.0')
     endif
   else
     error('Cannot find CUPS headers in default prefix.')


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